To implement the "Enter != Submit" problem, you can generally start from the "button type" and "number of input boxes". By default, for a single input box, regardless of whether the button is type="submit" or type="button", pressing Enter means submitting. 1. When type="submit", no matter how many type="text" input boxes there are, pressing Enter means submit. (submit) 2. When type="button" and there are multiple input boxes, pressing Enter does not submit. (button) 3. To solve the problem of submitting when pressing Enter in a single input box, refer to the second point: you can add an input="text" and hide it; then set the type to button. In actual applications, there is rarely only one input box, so you only need to remember the second rule to deal with it. Using JS events to prevent form submission is beyond the scope of this article, but it is certainly possible. |
<<: How to use docker compose to build fastDFS file server
>>: 9 super practical CSS tips to help designers and developers
Within rows, light border colors can be defined i...
Table of contents Preface: 1. Create a project wi...
Mixins provide distributed reusable functionality...
Original link: https://vien.tech/article/138 Pref...
The previous article introduced the implementatio...
Table of contents 1.DB,DBMS,SQL 2. Characteristic...
Forms in HTML can be used to collect various type...
Table of contents Use of CURRENT_TIMESTAMP timest...
First download VMware Workstation 15.1 version. I...
<iframe src="./ads_top_tian.html" all...
Table of contents MySQL result sorting - Aggregat...
Preface Many web applications store data in a rel...
Table of contents 1. Introduction 2. Simple epoll...
background go-fastdfs is a distributed file syste...
During the project optimization today, MySQL had ...