Submit avoid submitting multiple times and require the button to be unavailable after submit
Script function checkText () {var title = document. getElementsByName ('title') [0]. value; title = title. replace (/[]/g, ""); if (title! = "") {Return true;} else {alert ("cannot be blank! "); Return false ;}} script
How can I click submit to submit again?
Reply to discussion (solution)
Function checkText () {$ ("# go "). attr ('disabled ', true); // the submit button is invalid var title = document. getElementsByName ('title') [0]. value; title = title. replace (/[]/g, ""); if (title! = "") {Return true;} else {alert ("cannot be blank! "); Return false ;}}
You need to bind the form in JavaScript to submit this event, and write code in the callback function of this event to invalidate the button.
You need to bind the form in JavaScript to submit this event, and write code in the callback function of this event to invalidate the button.
Ah? It seems that it has never been changed.
This is a common single table page. when you click submit, the return page of the target program overwrites the original form.
Therefore, there is no issue of repeated click submission.
This requirement is required only when ajax is submitted.
In this case, you can set the deabled attribute of the submit button or use css to disable the display of the submit button.