當我提交的時候判斷是否被選中.如果選中就讓它的值欸"Y",否則為"N"基本代碼如下:
<script>
...
if(thisForm.nowThesisDomain.checked){
thisForm.nowThesisDomain.value="Y";
alert(thisForm.nowThesisDomain.value);
}else{
thisForm.nowThesisDomain.value="N";
alert(thisForm.nowThesisDomain.value);}
</script>
<html:checkbox property="nowThesisDomain"/>
就是從後台接受的時候,選中了
myForm.getNowThesisDomain()="Y",沒有選中的時候顯示的卻是""而不是"N"(但是在前台能夠alert出"N").為甚麼.