关于POST传值,加了一段js代码传不过去,去掉就可以,该怎么处理

WBOY
Release: 2016-06-13 12:49:25
Original
983 people have browsed it

关于POST传值,加了一段js代码传不过去,去掉就可以
加了验证登陆的js,然后点submit提交,uname的值和pwd的值,都为空,去掉js代码,就可以获得uname值和pwd值,为什么?


<script><br /> function formCheck(){<br /> if(myform.uname.value=""){<br /> alert("用户名不能为空!!");<br /> myform.uname.focus();<br /> return false;<br /> }<br /> if(myform.pwd.value=""){<br /> alert("密码不能为空!!!");<br /> myform.pwd.focus();<br /> return false;<br /> }<br /> <br /> }<br /> <br /> </script>
 
   


    用户名:

           密码:

      
   
   

------解决方案--------------------
if(myform.uname.value==""){
alert("用户名不能为空!!");
myform.uname.focus();
return false;
}
if(myform.pwd.value==""){
...
------解决方案--------------------
等于是两个等号
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!