表单验证问题 <input type="text" name="usrname" onblur="checkUsrName()">这样试试 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 将就你的代码改了一下,如要改别的逻辑靠你自己了<html><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><script type="text/javascript">function check(){ if(!checkUsrName()){ //alert("请输入用户名"); return false; } if(!checkPsw()){ //alert("请输入密码"); return false; } return true; }function checkUsrName(){ if(document.reg.usrname.value==""){ f_username.innerHTML="please enter your name"; return false; } f_username.innerHTML =""; return true;}function checkPsw(){ if(document.reg.psw.value==""){ f_psw.innerHTML="please enter the pwd"; return false; } f_psw.innerHTML =""; return true;}</script></style><form name="reg" action="1.jsp" onsubmit="return check();" method="post"><br/>userReg<table border="0" cellpadding="0" cellspacing="0"><tr><td>user</td><td><input type="text" name="usrname" onchange="checkUsrName()"><font color=red id=f_username></font></td></tr><tr><td>pwd</td> <td> <input type="password" name="psw" onchange="checkPsw()"><font color=red id=f_psw></font></td></tr></table><br/><input type="submit" value="sub"><input type="reset" value="res"></form></html> 写完一句下面copy 忘记改名字了 低级逻辑错误... 这个为什么是false? 如何用JavaScript获取<html:text>标签中的值.. javascript问题 感觉没问题但就是运行不对的代码,请兄弟们看看 jquery实现超出截取 以省略结束 texrarea好象不支持scrollTo方法 阿信主页上的一些COMPONENT,下载不了啊 关于iFrame装载页面时的背景颜色问题 先判断操作系统是简体中文的还是繁体中文的,然后再跳转到相应的页面,如何做? 在MSDN中看到body的内容,其中他的event里有很多如oncut。。。请问怎样使用这些事件??? var r=Math.random() 一个打印函数的问题,急问。
<html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">function check(){
if(!checkUsrName()){
//alert("请输入用户名");
return false;
} if(!checkPsw()){
//alert("请输入密码");
return false;
}
return true;
}function checkUsrName(){
if(document.reg.usrname.value==""){
f_username.innerHTML="please enter your name";
return false;
}
f_username.innerHTML ="";
return true;
}
function checkPsw(){
if(document.reg.psw.value==""){
f_psw.innerHTML="please enter the pwd";
return false;
}
f_psw.innerHTML ="";
return true;
}
</script>
</style><form name="reg" action="1.jsp" onsubmit="return check();" method="post">
<br/>userReg
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>user</td>
<td><input type="text" name="usrname" onchange="checkUsrName()"><font color=red id=f_username></font></td>
</tr>
<tr>
<td>pwd</td>
<td>
<input type="password" name="psw" onchange="checkPsw()"><font color=red id=f_psw></font></td>
</tr>
</table>
<br/>
<input type="submit" value="sub">
<input type="reset" value="res">
</form>
</html>