javascript - jQuery script doesn't work in safari when button is disabled -


I've written to prevent this form from accumulating more than once.

  jQuery.fn.preventDoubleSubmit = function () {this.find (": submit"). Each (function () {$ (this) .click (function () {this.originalValue = this.value; this.disabled = true; this.beenClicked = true;});}); // [...] back submit this (function () (if (this.been submit) {return false;} and {this.beenSubmitted = true;}});}; // [...] < / Code> 

Unfortunately, this does not work with Safari when I click on the form, the button is disabled and does not submit the safari form.

Someone Also consider?

You know that there is no need to click the button for the form, okay I think that you get a new perspective about this To prevent accounting double submissions, simply:

  $ (". Selector"). Submit (window.mySubmitHandler); function mySubmitHandler (evt) {$ (" # SubmitButton ") atr (" disabled ", true); // if you want, give other stuff here // refine the function in the window in the function I.mySubmitHandler = function (evt) {evt.preventDefault ();} Return True;}  

In this way, this will allow the function to be presented for the first time and overwrite it itself. Then the default of the event with every subsequent effort. Behavior will be stopped.


Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -