Find an interesting thing when researching a form-how do you ensure that the data is fully submitted before it is emptied when the form is submitted?
We used the <input type= "reset" value= "reset"/>, or jquery's $ (' input[name=xxx] ') Val ('), directly emptying the value of input, is simply empty directly, Do not wait for the data to be submitted after the empty, so there will be no end of data transfer achievements empty situation, how to solve?
Find an answer when searching--write a callback function that doesn't feel rigorous. Record it first and study it slowly later.
function Submit (callback) { document.getElementById ("MyForm"). Submit (); Callback ();} function Reset () { document.getElementById ("MyForm"). Reset ();} function Tijiao () { submit (reset);} <form id= "MyForm" action= "" ><input type= "text" name= ""/><input type= "button" value= "Commit" onclick= " Tijiao () "/></form>