Bytes --------------------------------------------------------------------------------------------------
Implement "press Enter! = Submit. Generally, you can start with "type" of the button and "Number of input boxes.
---------------------------- @ Chenwei <www. chenwei. ws> -------------------------------
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.
Bytes --------------------------------------------------------------------------------------------------