Use $ ("form"). Submit (); Unable to submit

Source: Internet
Author: User


<form action= "register.php" method= "POST" >
<div class= "Loginform_row" >
<label> User name:</label>
<input type= "text" class= "Loginform_input" id= "name" name= "name"/><div id= "Nameerror" ></div>
</div>
<div class= "Loginform_row" >
<label> Password:</label>
<input type= "text" class= "Loginform_input" id= "pass" name= "pass"/><div id= "Passerror" ></div>
</div>
<div class= "Loginform_row" >
<label> Email:</label>
<input type= "text" class= "loginform_input" id= "email" name= "email"/><div id= "Emailerror" ></div>
</div>
<div class= "Loginform_row" >
<input type= "button" class= "Loginform_submit" id= "Submit" value= "register"/> Change to <input type= "button" class= " Loginform_submit "id=" register "value=" registration "/>
</div>
<div class= "Clear" ></div>
</form>
$ ("#submit"). Click (function () {
$ ("form"). Submit ();
});


The above code cannot submit the form when you click the Register button

cause 
Additional Notes:
Forms and their child elements should does use input names or IDs that conflict with properties of a form, such as SUBM It, length, or method. Name conflicts can cause confusing failures. For a complete list of rules and to check your markup for these problems, see domlint.

Other Precautions:
The form and its child elements should not use the properties of a form property as name or ID names, such as submit, length, or method, are, will create a conflict. Name collisions can lead to confusing failures. For a complete list of rules, and check for these problem tags, see domlint.
so change the ID of the registration button to "register" and it's OK.


This article is from the "Kitten" blog, please be sure to keep this source http://huzhenjie.blog.51cto.com/863711/1607223

Use $ ("form"). Submit (); Unable to submit

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.