Home  >  Article  >  Web Front-end  >  Several methods for form submission

Several methods for form submission

一个新手
一个新手Original
2017-09-08 09:16:032399browse

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!

Statement:
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