当前位置:编程学习 > JS >>

JS验证,这块“牛皮”反复修改都不能实现

补充:<body onload="loading()"> <div id="pannel"> <div id="warning" class="warning" align="center">! Warning</div> <form name="notNone" id="notNone" action="" method="post" onsubmit="javascript:return checkInput()"> NAME:  <input type="text" id="user" class="input" >  KEY:  <input type="password" id="pass" class="input">  <input type="button" value=" >> "> <form> </div> <SCRIPT LANGUAGE="JavaScript"> function loading() { var a = document.getElementById("pannel"); a.style.left=(document.body.clientWidth/2-a.clientWidth/2)+"px"; a.style.top=(document.body.scrollTop+document.body.clientHeight/2-a.clientHeight/2)+"px"; document.getElementById("warning").style.display='none'; } </SCRIPT> <SCRIPT LANGUAGE="JavaScript"> function checkInput() { if((user.value.length=="")||(pass.value.length=="")) { document.getElementById("warning").style.display='true'; return false; } return true; } </SCRIPT> </body> </html>
追问:第一次用百度提问,我一开始以为是填写标题!最后一个验证,非空的JS不能自动识别ID或者NAME吗?必须得指的那么清楚吗?木有反应。气死。你在线我把文件发给你,你给我看看有一点点反应了,不过那个隐藏层还是不能显示
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,