"<script>osjs('#" + ButtonFeedback.Id + "').click(function(){osjs('#" + ButtonFeedback.Id + "')[0].disabled=true;})</script>"
Hi people!
Using server side solutions, like setting variables and refreshing buttons, might not do the trick. Succesfully preventing a double-click is usually attainable only using javascript.
The funny thing is, I have come across many people suggesting this, but they don't tell you exactly how to do it. To be really helpfull we should try to give the complete solution.
I had this problem and solved it the following way:
To disable the link, I gave a generic Class named (for instance) "PointerClass" to the link I was going to "disable/enable". Then, on the "onclick" extended property of the Link, I set:
"$('.PointerClass').css('pointer-events','none');"
To enable the Link again, I put a Javascript action at the end of the action called, with the code :
"$('.PointerClass').css('pointer-events','auto');"
Regards,
Adérito Angelino
Adérito Angelino wrote:
Adérito Angelino
Hi,
I tried the PreventSpamClicks in a table records with buttons and it prevented clicking at all. With the JQuery script it did work!
Gr., Menno
Here is a pattern that I have implemented previously that uses both client and server side locking to prevent multiple submissions.
if ($('#' + entry.Id).val() !== '') { $('#' + Save.Id + "').attr('disabled',disabled");}
Very nice solution this JS, works flawlessly :)