Action is the form attribute, and onSubmit is the event. To explain the sequence of execution, I personally think it is onSubmit first. Below is a good example to help you better immediately, do not miss out. 1. action is the form attribute. html5 has defined it as a required attribute value, and onSubmit is an event. Perform a function verification when submitting the request ..
Second: To explain the sequence of execution, I personally think it is onSubmit first. First, verify. If the result is false, action = "url" cannot be reached. If true is returned or no return value is returned, the url address is switched.
The Code is as follows:
Function check (){
Var oText = document. getElementById ("in"). value;
Alert (oText );
If (oText = "false "){
Return false;
}
Else {
Return true ;}
}
The Code is as follows:
OnSubmit = "return Fun ();" Here the return must be written. Do not write? If you do not want to write it, try it !!!
In short, onSubmit is used for verification and action is the link address after the jump.