Home > Web Front-end > H5 Tutorial > body text

Is submit a button in html5?

王林
Release: 2023-01-03 09:25:01
Original
3525 people have browsed it

Submit is a button in HTML5. It is a special case of button. It automatically integrates the submission action. Submit will automatically submit the form data. When using submit, you need to verify and add return true or false.

Is submit a button in html5?

The operating environment of this article: windows10 system, html 5, thinkpad t480 computer.

Submit is a special case of button and a type of button. It automatically integrates the submission action.

If the form needs to be processed with JS (including input verification) after clicking the submit button before submitting it, you usually have to change submit to button, that is, cancel its automatic submission behavior. Otherwise, it will cause The effect of submitting twice, for dynamic web pages, is to operate the database twice. Or add return true or false when verifying when using submit.

Submit and button are both displayed in the form of buttons. They both look like buttons. The difference is in the type attribute and the event that is sent in response. Submit will submit the form, but button will not submit the form.

Submit is a special button that will automatically submit the form data. If the onClick method does not add return, it will automatically submit and will not act as a constraint. Therefore, if you need to verify when using submit, please add return true or false.

Example: , when judging in JS, write return true; Or return false;

Recommended learning:html tutorial

The above is the detailed content of Is submit a button in html5?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template