The action and onsubmit examples of form forms are described in

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.