How do I remove the form and press enter, that is, submit or press enter! = Submit _ HTML/Xhtml _ webpage Creation
Source: Internet
Author: User
By default, a single input box, regardless of the typesubmit or typebutton type of the button, returns are submitted, then how to remove the form and press enter to submit, the following is a good example. You can refer to the following implementation: "press Enter! = Submit. Generally, you can start with "type" of the button and "Number of input boxes.
By default, no matter the type = "submit" or type = "button" type of the button in a single input box, press enter to submit.
1. When type = "submit", whether there are several type = "text" input boxes, press enter to submit. (Submit)
2. When type = "button" and there are multiple input boxes, press enter to not submit. (Button)
3. Solve the Problem of submitting a single input box by pressing enter. Refer to the second point: you can add an input = "text", hide it, and set the type to button.
In practice, there is only one input box, so you only need to remember the second one.
Blocking form submission by using JS events is not covered in this article. Of course, it can also be implemented.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.