js判断radio是否被选中(一)
2011-06-02 12:35
405 查看
< 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 >
相关文章推荐
- JS 判断单选框(radio)是否被选中(二)
- js判断radio是否被选中(二)
- JS动态判断radio是否被选中的问题
- JS 判断单选框(radio)是否被选中
- js判断radio是否被选中(一)
- js判断radio是否被选中(一)
- JS如何判断单个radio是否被选中
- js判断单选按钮是否被选中
- jquery1.10.*以上的版本中用jquery判断radio和checkbox是否被选中
- 本人的开发中的一些笔记(一)js判断页面中多个checkbox是否至少被选中一个
- 判断radio是否被选中
- JS 判断 Radio 单选按钮是否为选中状态 并弹出 值信息
- 判断radio 是否被选中
- 如何用js判断一个复选框是否被选中
- js小技巧-判断表格是否被选中
- 【js小方法】提交表单是,判断单选框是否被选中
- radio 判断一个元素是否被选中
- jquery 判断 radio,checkbox,select是否被选中
- js判断复选框checkbox数组是否被选中
- 用js 判断datagrid 中的 checkbox 是否被选中