Home > Article > Web Front-end > Several methods for form submission
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!