Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What does submit mean in html

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report