当前位置: 首页 > 图文教程 > 网络编程 > JSP > JSP单选按钮验证、下拉框验证、复选框验证实现代码

JSP
我认为JSP有问题(上)
我认为JSP有问题(下)
jsp“抓”网页代码的程序
关于在bean里面打印html的利弊看法
bean里面如何打印到html页面
jdbc3中的RowSet 接口规范
Apusic Application Server1.0中jsp源代码泄漏漏洞
Unify的eWave ServletExec拒绝服务漏洞
通过提交超长的GET请求导致IBM HTTP Server远程溢出
在HTTP请求中添加特殊字符导致暴露JSP源代码文件
Resin 1.2 重要源代码暴露漏洞
多中WEB服务器的通用JSp源代码暴露漏洞
Tomcat 暴露JSP文件内容
IBM WebSphere Application Server 暴露JSP文件内容
JRun 2.3.x 范例文件暴露站点安全信息
BEA WebLogic 暴露源代码漏洞
IBM WebSphere Application Server 3.0.2 存在暴露源代码漏洞
Tomcat 3.1 存在暴露网站路径问题
Sun Java Web Server 能让攻击者远程执行任意命令
Netscape 修复 JAVA 安全漏洞

JSP单选按钮验证、下拉框验证、复选框验证实现代码


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-13   浏览: 213 ::
收藏到网摘: n/a

单选按钮验证、下拉框验证、判断是否选择了至少一个CheckBox //验证性别(单选按钮验证)
function checkXb(){
var temp = false;
var xbObj1= document.getElementById("xb1");
var xbObj2= document.getElementById("xb2");
if(xbObj1.checked || xbObj2.checked){
temp = true;
}
return temp;
}
function checkform() {
//验证性别(单选按钮验证)
if(!checkXb()){
alert("请选择性别");
return false;
}
//验证人员类别(下拉框验证)
if(document.getElementById("lb").selectedIndex == 0){
alert("请选择人员类别");
return false;
}
}
// (复选框验证)判断是否选择了至少一个CheckBox.
function checkSelectedOne(cbxName){
var cbxs = document.getElementsByName(cbxName);
if(cbxs != null){
if(cbxs.length){
for(var i=0; i<cbxs.length; i++){
if(cbxs[i].checked) {
return true;
}
}
}else{
return cbxs.checked
}
}
return false;
}
if(!checkSelectedOne('xgjzh')){
alert("你没有选择!");
}