js验证单选按钮不能为空,怎么写验证码,谢谢

<th align="right"><b class="must">*</b> <font class="inf_regist" style="font-weight:100;">性 别:</font></th>
<td>
<asp:RadioButtonList ID="RB_GenderList" runat="server"
RepeatDirection="Horizontal" >
</asp:RadioButtonList>

第1个回答  2013-09-25
js函数
function checkSex(){
var sex = document.getElementsByName("radiobutton");
for(var i=0;i<sex.length;i++){
if(sex[i].checked==true){
return true;
}
}
alert("请选择性别");
return false;
}追问

var sex = document.getElementsByName("radiobutton");
for(var i=0;i<sex.length;i++){
if(sex[i].checked==true){
return true;
}
alert("请选择性别");
return false; }

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网