First: action is an attribute of form. HTML5 has defined it as a required attribute value. onSubmit is an event, and a function verification is performed when submitting through <input type="submit" />. . Second: As for the order of execution, my personal understanding is that onSubmit comes first, then verification. When the verification returns false, the action="url" address cannot be reached. If it returns true or no return value is given, it passes and redirects to the URL address. Copy code The code is as follows:function check(){ var oText = document.getElementById("in").value; alert(oText); if(oText == "false"){ return false; } else { return true;} }</span> Copy code The 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();" The return here must be written, shouldn't it be written? You can try not to write! ! ! In short: onSubmit is for verification, and action is the link address after the jump. |
<<: JavaScript function detailed introduction
>>: How to build ssh service based on golang image in docker
Table of contents What is MySQL NDB Cluster Preli...
Preface The computer I use is a Mac, and the oper...
Due to the default bridge network, the IP address...
When MySQL performs DDL operations such as alter ...
Create a user: create user 'oukele'@'...
first step Delete it once with the built-in packa...
Original Intention The reason for making this too...
1. Multiple borders[1] Background: box-shadow, ou...
Table of contents summary Problem Description Ana...
It is very common to use webpack to build single-...
The google.html interface is as shown in the figur...
As shown below: from table where condition group ...
This article shares the specific code of JavaScri...
I have written an article about mobile adaptation...
Table of contents Install Tomcat with Docker Use ...