Form interaction is indispensable in web development. In reality, there is such a bug. After you fill out the form, click the submit button. If the website is slow, the page does not jump for half a day, you can click the submit button without stopping, causing data to be submitted repeatedly. This probability is not negligible. The author will share with you how to prevent repeated submission.
Simply put, after you click the submit button, if all the data passes the verification and is qualified, you can submit data and set the button to not clickable.
Code that cannot be clicked for the jquery setting button (the setting id = phpernote button cannot be clicked ):
$("#phpernote").attr("disabled",true);
Or
$("#phpernote").attr("disabled","disabled");
Code indicating that the javascript setting button cannot be clicked (the setting id = phpernote button cannot be clicked ):
<Input onclick = "document. getElementById ('phpernote '). setAttribute ('Disabled ', true); "type =" button "id =" phpernote "value =" Submit "/>
Articles you may be interested in
- How jquery ajax prevents repeated submissions
- Javascript determines whether the mouse is left or right-click-compatible with ie, firefox, chrome, and other major browsers
- Shoulder, back muscle group exercise-Bring Up-bend up rowing-Move up-Stand Up-Stand up weight bend up-Sit posture neck pull down-bend upright hold up-neck front wide hold up
- PHP allows multiple second-level domain names on the same server to share SESSION data
- Summary of several methods for setting time zones in PHP
- In php, we use the curl post method to submit data and the get method to obtain webpage data.
- Php clears (deletes) the files in the specified directory, and does not delete the directory folder.
- Js: Click enter and move the cursor to the next input box.