function logincheck(){ if (loginform.user.value=""){ alert ("请输入用户名&quo"/> function logincheck(){ if (loginform.user.value=""){ alert ("请输入用户名&quo">
新手求问,关于js登录验证问题
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--><script type="text/javascript"> function logincheck(){ if (loginform.user.value=""){ alert ("请输入用户名"); loginform.user.focus(); return false; } if (loginform.pw.value=""){ alert ("请输入用户名"); loginform.pw.focus(); return false; } }</script></head><body> <div id="login"> <div id="top"> <div id="top_left"><img src="images/login_03.gif" /></div> <div id="top_center"></div> </div> <form action="login.php" method="post" name="loginform" onsubmit="return logincheck(this);"> <div id="center"> <div id="center_left"></div> <div id="center_middle"> <div id="user">用 户 <input type="text" name="user" /> </div> <div id="password">密 码 <input type="password" name="pw" /> </div> <div id="btn"> <input type="submit" value="登录" name="submit" /> <input type="reset" value="取消" name="reset"/> </div> </div> <div id="center_right"></div> </div> </form> <div id="down"> <div id="down_left"> <div id="inf"> <span class="inf_text">版本信息</span> <span class="copyright">留言管理系统 2012 v1.0</span> </div> </div> <div id="down_center"></div> </div> </div></body>