This article mainly introduces the AJAX Submission Form form page will still refresh the problem of a quick solution, and the form form in the presence of the button when the Ajax automatically refresh the problem, the need for friends can refer to, hope to help everyone.
For a long while, the original click submit button to add a type= "button" is <form > <button id= "sub"/> </form> results will refresh the page, plus just fine
Ps:form Auto Refresh after Ajax commit when button is present in form
In the record a pit (just learn the front desk, not very understand, the project himself to dig a hole, haha ... ) <form class= "Form-horizontal" ><p class= "Form-group" ><label class= "col-sm-3 Control-label" > Modified data name: </label><p class= "col-sm-7" > <input type= "text" placeholder= "test22" class= "Form-control" > </p><p class= "col-sm-2" ><button class= "btn btn-primary" onclick= "Resetcertificatename" > Modify </button></p></p></form>
When a button tag is present in a form, the form is asynchronously submitted with Ajax, and the face is refreshed. (It feels weird)
Cause: When the button is present, the form is submitted again, so the page is refreshed. (Previously thought that button type= ' submit ') button has the ability to submit the form.
FIX: The button label will be replaced with a label. <a class= "btn btn-primary" onclick= "Resetcertificatename" > Modify </a>