关于单选框 怎么样才能实现这个功能,就是单选身份证号,则下面显示需要输入的是身份证号和姓名;单选准考证号,下面显示的是准考证号和姓名? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 思路:onclick 传个type表示要显示的是身份证号和姓名或者准考证号和姓名方法:1:见楼上2:$('id').append('<input type="text" value='在此输入....'>') 2:$('id').after('<input type="text" value='在此输入....'>') 给个默认值,用hide()和show()方法切换。 <li id="outInvestment"> <label for="outInvestment">外省投入<font color="red">*</font></label> <input id="outInvestment" type="text" name="pds.outInvestment" class="validate[required,custom[number]]" value="" /> </li>$("#outInvestment").hide();$("#outInvestment").show();参考这个例子,把你的换掉就行了。 给你一个参考代码<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><%%><title>系统登录</title><script> javascript:window.history.forward(1);//禁止后退//隐身,显示 口令码 function showadv(pp) { if (pp == 0) { document.getElementById("adv").style.display = "block"; }else{ document.getElementById("adv").style.display = "none"; }}function isNum(passedVal){ if(passedVal==""){ return false; } for(i=0;i<passedVal.length;i++){ if(passedVal.charAt(i)<"0") {//如果输入值小于0,则错误 return false; } if(passedVal.charAt(i)>"9") {//如果输入值不在0-9范围内,则错误 return false; } } return true; }function isValid(){ var chk=3; for(var i=0;i<form.js.length; i++) { if(form.js[i].status== true) { chk=form.js[i].value; } } if(chk==3) { alert("请选择 '角色' !"); return false; }if(document.form.word.value=="") { window.alert("请填写用户ID!"); document.form.word.focus(); return false; }if(document.form.word.value=="") { window.alert("请填写密码!"); document.form.word.focus(); return false; }if(document.form.yanzhengma.value=="") { window.alert("请填写验证码!"); document.form.word.focus(); return false; }if(isNum(document.form.yanzhengma.value)==false){ window.alert("请正确填写验证码!"); document.form.wnum.focus(); return false; } if(chk==0) { if(document.form.kcnum.value=="") { window.alert("请填写考场口令码!"); document.form.kcnum.focus(); return false; } }}</script> <STYLE type=text/css>.STYLE1 { FONT-SIZE: 12px; COLOR: #0da209}A.a1:visited { FONT-SIZE: 12px; COLOR: #000000; TEXT-DECORATION: underline}A.a1:link { FONT-SIZE: 12px; COLOR: #000000; TEXT-DECORATION: underline}A.a1:active { FONT-SIZE: 12px; COLOR: #000000; TEXT-DECORATION: underline}A.a1:hover { FONT-SIZE: 12px; COLOR: #ff0000; TEXT-DECORATION: underline}.STYLE2 {font-size: 12px}body { background-color: #999999; margin-top: 0px; margin-bottom: 0px;}.STYLE4 {font-size: 12px; color: #00CC00; }</STYLE> <style>html,body{height:100%} </style> </head><body leftmargin="0" topmargin="0" BGCOLOR="#2C89CF"><form name="form" method="post" action="log.jsp" onSubmit="return isValid();"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="609"><img src="images/top1.gif" width="609" height="91" /></td> <td width="100%" bgcolor="#2C89CF"></td> </tr></table><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="41" background="images/bak1.gif"></td> </tr></table><table style="width:100%; height:69%;" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td bgcolor="#F5F5F5" > <table width="295" height="27" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC"> <tr> <td width="32" height="27" align="right" background="images/top6.gif"><img src="images/tu7.gif" width="20" height="20" /></td> <td width="263" valign="baseline" background="images/top6.gif"><span class="STYLE1"> 欢迎登录考试系统! <FONT SIZE="2" COLOR="#3300CC"><A class=close onclick="var win = showModelessDialog('about.jsp', window,'dialogWidth:500px;dialogHeight:350px;status:no;resizable:yes;scroll:auto');" href="#">版权所有</A></FONT> <a href="querykd.jsp" target=_blank>查询考点</a></span></td> </tr> </table> <table width="295" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="1" height="160" background="images/top7.gif"></td> <td width="275"> <table width="234" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align="right" height="28" width="69"><span class="STYLE2">角色:</span></td> <td width="165"><FONT SIZE="2" COLOR=""> <INPUT TYPE="radio" NAME="js" value="1" onclick="showadv(1)" >老师(管理员) <INPUT TYPE="radio" NAME="js" value="0" onclick="showadv(0)"> 学生</FONT></td> </tr> </table> <table width="234" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align="right" width="69"><span class="STYLE2">用户ID:</span></td> <td width="165"><input type="text" name="wnum" style="BACKGROUND-COLOR: #0099FF; COLOR: #0000CC" /></td> </tr> </table> <table width="234" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align="right" width="69"><span class="STYLE2"> 密 码:</span></td> <td width="165"><input type="password" name="word" style="BACKGROUND-COLOR: #0099FF; COLOR: #0000CC" /></td> </tr> </table> <table width="234" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align="right" width="69"><span class="STYLE2">验证码:</span></td> <td width="165"><input type="text" name="yanzhengma" style="BACKGROUND-COLOR: #99CCFF; COLOR: #0000CC" size="4" maxlength="4" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')" /> <img src="image.jsp" /></td> </tr> </table> <table width="234" border="0" align="center" cellpadding="0" cellspacing="0" class="tableborder1" id="adv" style="DISPLAY: none" name="adv"> <tr> <td align="right" width="69"><span class="STYLE2">考场口令码:</span></td> <td width="165"><input type="text" name="kcnum" size="6" maxlength="6" style="BACKGROUND-COLOR: #0099FF; COLOR: #0000CC" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')" /></td> </tr> </table> <table width="202" border="0" align="center" cellpadding="0" cellspacing="10"> <tr> <td width="193" height="40"><div align="right"><INPUT type="image" height=22 width=50 src="images/denlu.gif" style="WIDTH: 50px; HEIGHT: 22px" value=Submit name=submit /> </div></td> </tr> </table> <table width="200" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="23"><span class="STYLE4">*请输入用户名及密码登录</span></td> </tr> </table></td> <td width="3" background="images/top8.gif"></td> </tr> </table> <table width="295" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td background="images/top9.gif"></td> </tr> </table></td> </tr></table><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="49" background="images/top3.gif"></td> </tr></table></form></body></html> 关于jsp中按钮名称显示错误的问题 Struts1 ActionForm Validate中使用资源文件 hibernate查询子表对象在页面上找不到!!!! 什么情况下 要重写部署 请问:把用户权限放在用户 session 中会不会不安全 使用reflect机制动态执行一个类的一个方法,可是类的构造函数是私有的,怎么办啊? 新手:刚接触JAVA,准备学JSP.有没有建议一下如何学? 一个关于安全性的问题 大家帮我理理思路!! 一个关于class放置的简单问题 Struts2返回自定义Json 求高手解答网站安全机制或者是说安全证书的问题
onclick 传个type表示要显示的是身份证号和姓名或者准考证号和姓名
方法:
1:见楼上
2:$('id').append('<input type="text" value='在此输入....'>')
<label for="outInvestment">外省投入<font color="red">*</font></label>
<input id="outInvestment" type="text" name="pds.outInvestment" class="validate[required,custom[number]]" value="" />
</li>$("#outInvestment").hide();
$("#outInvestment").show();
参考这个例子,把你的换掉就行了。
给你一个参考代码<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<%%>
<title>系统登录</title>
<script>
javascript:window.history.forward(1);//禁止后退
//隐身,显示 口令码
function showadv(pp)
{
if (pp == 0) {
document.getElementById("adv").style.display = "block";
}else{
document.getElementById("adv").style.display = "none";
}
}
function isNum(passedVal){
if(passedVal==""){
return false;
}
for(i=0;i<passedVal.length;i++){
if(passedVal.charAt(i)<"0") {//如果输入值小于0,则错误
return false;
}
if(passedVal.charAt(i)>"9") {//如果输入值不在0-9范围内,则错误
return false;
}
}
return true;
}
function isValid(){ var chk=3;
for(var i=0;i<form.js.length; i++)
{
if(form.js[i].status== true)
{
chk=form.js[i].value;
}
}
if(chk==3)
{
alert("请选择 '角色' !");
return false;
}if(document.form.word.value=="")
{
window.alert("请填写用户ID!");
document.form.word.focus();
return false;
}
if(document.form.word.value=="")
{
window.alert("请填写密码!");
document.form.word.focus();
return false;
}
if(document.form.yanzhengma.value=="")
{
window.alert("请填写验证码!");
document.form.word.focus();
return false;
}
if(isNum(document.form.yanzhengma.value)==false){
window.alert("请正确填写验证码!");
document.form.wnum.focus();
return false;
} if(chk==0)
{
if(document.form.kcnum.value=="")
{
window.alert("请填写考场口令码!");
document.form.kcnum.focus();
return false;
}
}
}
</script>
<STYLE type=text/css>
.STYLE1 {
FONT-SIZE: 12px; COLOR: #0da209
}
A.a1:visited {
FONT-SIZE: 12px; COLOR: #000000; TEXT-DECORATION: underline
}
A.a1:link {
FONT-SIZE: 12px; COLOR: #000000; TEXT-DECORATION: underline
}
A.a1:active {
FONT-SIZE: 12px; COLOR: #000000; TEXT-DECORATION: underline
}
A.a1:hover {
FONT-SIZE: 12px; COLOR: #ff0000; TEXT-DECORATION: underline
}
.STYLE2 {font-size: 12px}
body {
background-color: #999999;
margin-top: 0px;
margin-bottom: 0px;
}
.STYLE4 {font-size: 12px; color: #00CC00; }
</STYLE>
<style>html,body{height:100%} </style> </head>
<body leftmargin="0" topmargin="0" BGCOLOR="#2C89CF"><form name="form" method="post" action="log.jsp" onSubmit="return isValid();"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="609"><img src="images/top1.gif" width="609" height="91" /></td>
<td width="100%" bgcolor="#2C89CF"></td>
</tr>
</table><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="41" background="images/bak1.gif"></td>
</tr>
</table>
<table style="width:100%; height:69%;" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#F5F5F5" >
<table width="295" height="27" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC">
<tr>
<td width="32" height="27" align="right" background="images/top6.gif"><img src="images/tu7.gif" width="20" height="20" /></td>
<td width="263" valign="baseline" background="images/top6.gif"><span class="STYLE1"> 欢迎登录考试系统! <FONT SIZE="2" COLOR="#3300CC"><A class=close onclick="var win = showModelessDialog('about.jsp', window,'dialogWidth:500px;dialogHeight:350px;status:no;resizable:yes;scroll:auto');" href="#">版权所有</A></FONT> <a href="querykd.jsp" target=_blank>查询考点</a></span></td>
</tr>
</table>
<table width="295" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="1" height="160" background="images/top7.gif"></td>
<td width="275">
<table width="234" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="right" height="28" width="69"><span class="STYLE2">角色:</span></td>
<td width="165"><FONT SIZE="2" COLOR=""> <INPUT TYPE="radio" NAME="js" value="1" onclick="showadv(1)" >老师(管理员) <INPUT TYPE="radio" NAME="js" value="0" onclick="showadv(0)"> 学生</FONT></td>
</tr>
</table>
<table width="234" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="right" width="69"><span class="STYLE2">用户ID:</span></td>
<td width="165"><input type="text" name="wnum" style="BACKGROUND-COLOR: #0099FF; COLOR: #0000CC" /></td>
</tr>
</table>
<table width="234" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="right" width="69"><span class="STYLE2"> 密 码:</span></td>
<td width="165"><input type="password" name="word" style="BACKGROUND-COLOR: #0099FF; COLOR: #0000CC" /></td>
</tr>
</table> <table width="234" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="right" width="69"><span class="STYLE2">验证码:</span></td>
<td width="165"><input type="text" name="yanzhengma" style="BACKGROUND-COLOR: #99CCFF; COLOR: #0000CC" size="4" maxlength="4" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')" /> <img src="image.jsp" /></td>
</tr>
</table>
<table width="234" border="0" align="center" cellpadding="0" cellspacing="0" class="tableborder1" id="adv" style="DISPLAY: none" name="adv">
<tr>
<td align="right" width="69"><span class="STYLE2">考场口令码:</span></td>
<td width="165"><input type="text" name="kcnum" size="6" maxlength="6" style="BACKGROUND-COLOR: #0099FF; COLOR: #0000CC" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')" /></td>
</tr>
</table>
<table width="202" border="0" align="center" cellpadding="0" cellspacing="10">
<tr>
<td width="193" height="40"><div align="right"><INPUT type="image" height=22 width=50 src="images/denlu.gif" style="WIDTH: 50px; HEIGHT: 22px" value=Submit name=submit /> </div></td>
</tr>
</table>
<table width="200" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="23"><span class="STYLE4">*请输入用户名及密码登录</span></td>
</tr>
</table></td>
<td width="3" background="images/top8.gif"></td>
</tr>
</table>
<table width="295" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td background="images/top9.gif"></td>
</tr>
</table></td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="49" background="images/top3.gif"></td>
</tr>
</table>
</form>
</body>
</html>