Get the App
SLTechnology News&Howtos  ›  Development  › 

What does submit mean in html

Shulou Source: shulou.com Published: 2022-06-01 05:32:19 10月28日 Update

This article is about what submit means in html. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

The Submit object represents a submit button (submitbutton) in the HTML form. Every time a tag appears in an HTML form, a Submit object is created.

Before the form is submitted, the onclick event handle is triggered, and a handle can cancel the form submission by returning false.

See the Form.submit () method and the Form.onsubmit event handle.

You can access a submit button by iterating through the form's elements [] array, or by using document.getElementById ().

IE:InternetExplorer,F:Firefox,O:Opera,W3C:W3C standard.

Examples

Functionvalidate ()

{

Varat=document.getElementById ("email") .value.indexOf ("@")

Varage=document.getElementById ("age"). Value

Varfname=document.getElementById ("fname"). Value

SubmitOK= "true"

If (fname.length > 10)

{

Alert ("first name must be less than 10 characters.")

SubmitOK= "false"

}

If (isNaN (age) | | age100)

{

Alert ("Age must be a number between 1 and 100.")

SubmitOK= "false"

}

If (at==-1)

{

Alert ("not a valid email address.")

SubmitOK= "false"

}

If (submitOK== "false")

{

Returnfalse

}

}

First name (10 characters maximum):

Age (from 1 to 100):

Email:

Thank you for reading! This is the end of the article on "what is the meaning of submit in html". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Tags: Forms handles meaning events content can be passed by name character object age button more e-mail article email good practical valid between Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Shulou Tech Info MySQL NVidia Redmi