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

Several methods for form submission

一个新手
Release: 2017-09-08 09:16:03
Original
2407 people have browsed it

How to get the attribute values ​​of input and other controls in the form

Get the control first

Document.getElements*******

Form name. Control name

Value

How to determine whether the radio button and multi-select box are selected?

According to the checked attribute, if selected, it returns true, otherwise it returns false

How to submit the form, and the verification method

Two methods:

1. Button type =”submit”

Verification: add onsubmit=”return foo()”

to form tag Define foo()

in script function foo(){

                                                                                                                                                                 . ”

Add click event foo()

to button Define foo()

in script Function foo(){

//Verification passed Manually trigger form submission or form name.submit();

//Verification failed reture false;

}

The above is the detailed content of Several methods for form submission. 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