This topic is locked
[SOLVED]

 Preventing Double Submission

9/20/2011 12:08:57 PM
PHPRunner General questions
T
text author

Hi
I have an ajax submission button that I have inserted as a custom field in each row of a list page. It works perfectly however what I would like to be able to do is grey it out/disable it once it has been clicked to prevent double submission.
I'm wondering if anyone has any ideas how I can achieve this.
Thanks
Richard

C
cgphp 9/20/2011

In the javascript onLoad event:



$("input[type='button'][id^='your_button_id']").click(function(e){



//here the ajax call
$(this).attr("disabled","disabeld");

});


If the id of your submit button will be something like:



mybutton1

mybutton2

mybutton3

...

...

mybuttonN


in the code above, the id filter will be:

[id^='mybutton']
T
text author 9/21/2011

Cristian
Thank's very much. Your posts are always top quality.
Richard



In the javascript onLoad event:



$("input[type='button'][id^='your_button_id']").click(function(e){
//here the ajax call
$(this).attr("disabled","disabeld");

});


If the id of your submit button will be something like:



mybutton1

mybutton2

mybutton3

...

...

mybuttonN


in the code above, the id filter will be:

[id^='mybutton']