function validate(){var resualt=false;for(var i=0;i{_js判断radio是否选中">
当前位置:   article > 正文

js判断radio是否被选中(一)_js判断radio是否选中

js判断radio是否选中

< html >
< head >
< title >
votejsp
< / title >
< script language = "javascript" type = "text/javascript" >
<!--
function validate(){
var resualt=false;
for(var i=0;i<document.frmvote.radiobutton.length;i++)
{
    
    if(document.frmvote.radiobutton[i].checked)
    {
      resualt=true;
    }
}
if(!resualt)
{
    alert(" 为啥不选一个捏~!");
}
return resualt;
}
-->

< / script >
< / head >
< body bgcolor = "#ffffff" >
< h1 >
关于购房热潮的调查问卷


< / h1 >
< h3 >
问题1:如今房价居高不下,
< / h3 >
< form method = "post" action = "voteservlet" name = "frmvote" onsubmit = "return(validate())" >
< br > < br >
请选择:< br / >
< input type = "radio" name = "radiobutton" value = "A" / > A . 拥有一套货一套以上< br / >
< input type = "radio" name = "radiobutton" value = "B" / > B . 还没有,不过计划要买< br / >
< input type = "radio" name = "radiobutton" value = "C" / > C. 有这个想法,不过 还没有< br / >
< input type = "radio" name = "radiobutton" value = "D" / > D. 没有这个 想法,不买房< br / >
< input type = "submit" name = "Submit" value = "投票" >
< input type = "reset" value = "重新选择" >
< / form >
< / body >
< / html >

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/笔触狂放9/article/detail/613497
推荐阅读
相关标签
  

闽ICP备14008679号