A friend may directly use JS or jquery to submit data instead of using the form to submit directly, small to introduce you to the small part of the problem is that submit () can not be submitted, the following we look at the solution and reason analysis.
jquery cannot be submitted
The code is as follows |
Copy Code |
<form action= "register.php" method= "POST" > <label> Email:</label> <input type= "text" class= "loginform_input" id= "email" name= "email"/><div id= "Emailerror" ></div> <input type= "button" class= "Loginform_submit" id= "Submit" value= "register"/>
</form> <script> $ ("#submit"). Click (function () { $ ("form"). Submit (); }); </script> |
When I submit to find that the hair is not properly submitted, and then use the FF browser to check the error when I found that we have a id= "submit", so that the solution is out of the way we put
The code is as follows |
Copy Code |
<input type= "button" class= "Loginform_submit" id= "Submit" value= "register"/>
Switch <input type= "button" class= "Loginform_submit" id= "register" value= "register"/> |
Again to submit the registration can be submitted, below to introduce a friend to use JS also touched the same problem
, you need to use JS to submit form form. Found using Document.form1.submit (); Method failed to submit form. Firefox hints that submit is not a function. Finally find the solution.
1. There is no name= "submit" label in the form----that's my problem.
2
The code is as follows |
Copy Code |
. <form action= "expat_search.php" name= "Expat_search" id= "Expat_search" method= "post" enctype= "multipart/ Form-data "; |
The enctype= "Multipart/form-data" is not missing from the form.
3. When using JS for form verification: JS Verification script can be placed in two places 1) placed in the form header label.
2) put in
The code is as follows |
Copy Code |
<input type= ' Submit ' onsubmit= ' Js_code () '/> |
, 3) put in
The code is as follows |
Copy Code |
<input type= ' buttom ' onclick= ' js_code () '/> |
This is summarized below if you use 2) or 3) label mode. Must submit = ' onsubmit ', buttom=> ' onclick ' into the use of the wrong can not be changed. such as <input type= ' submit ' onclick= ' Js_code () '/> This is wrong.
Original address: http://www.php100.com/html/program/jquery/2013/0905/5935.html