Action is the property of the form, onsubmit for events, to say the order of execution, personal understanding is onsubmit first, there is a good example below to help everyone better immediately, interested friends do not miss
First: Action is the property of the form, HTML5 has defined it as a required property value, OnSubmit is an event, and a function validation is performed by <input type= "Submit"/> commit.
Second: To say the order of execution, personal understanding is onsubmit First, verify, verify return False, you cannot reach the action= "url" address. If true is returned or no return value is, then the URL address is passed and turned.
Copy CodeThe code is as follows:
<span style= "font-size:14px" > Function check () {
var otext = document.getElementById ("in"). Value;
alert (Otext);
if (Otext = = "false") {
return false;
}
else {
return true;}
}</span>
Copy CodeThe code is as follows:
<span style= "font-size:14px" > <form action= "table1.html" onsubmit= "return check ();" >
<div><input type= "text" id= "in"/><input type= "Submit" value= "Submit"/></div>
</form></span>
Onsubmit= "return fun" here is the return must be written, do not write? Do not write you can try!!!
In summary: OnSubmit is the verification that the action is the link address after the jump.
The action and onsubmit examples of form forms are described in