struts下checkbox的疑惑.
我提交的候判是否被中.如果中就它的值 "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 "/>
我中的候checkbox的值 "Y ",但是我不的候就是 " "但行上面的elsealert的是 "N ",不太明白..
[解决办法]
?????
else{
thisForm.nowThesisDomain.value= "N ";
alert(thisForm.nowThesisDomain.value);
}
这个 "N "不是你自己设的吗?
[解决办法]
thisForm.nowThesisDomain.value= "N ";
肯定
[解决办法]
不明白
[解决办法]
在From中设置
private NowThesisDomain = "N ";