View Full Version : Disable "Submit" Button while sending Post?
ElForro
03-14-2006, 08:09 AM
Hi... Little question... Is there someway to "disable" the submit button once clicked?
This is because some times my users double-click the button by accident or because they don't "understand" the AJAX effect and click again... And then they post 2 or 3 times... So, maybe a way to disable the button will prevent this... I remember seeing this in some way of JavaScript, but i can't found it... And I've search the forum too... sorry if someone have already asked...
Thanks! :)
ElForro
03-18-2006, 01:59 AM
I've fount this:
<script type="text/javascript">
function disable_enable(){
if (document.all || document.getElementById){
if (document.vbform.sbutton.disabled==false)
document.vbform.sbutton.disabled=true
else
document.vbform.sbutton.disabled=false
}
}
</script>
And then you need to add this to the submit button:
onclick="javascript:disable_enable()"
The problem with the "Quick Reply" is when you use AJAX, because the button will be disabled after your post... And if you set a minimun characters needed per post, the button will be still inactive after the alert... So, if anyone know how to use this Javascript would be nice... Especially for "unexpected" double clicks in the button...
Tralala
03-18-2006, 02:21 AM
Agreed, I would very much like to see a fix/workaround for this. I get lots of double-posts as a result of folks double-clicking.
Code Monkey
03-18-2006, 02:56 AM
Just set a minimum time between posts.
ElForro
03-18-2006, 03:42 AM
JumpD, I've got a minimun time, AND a "Merge Double Post" hack.... but sometimes none of them works, and I still get double posts...
Tralala
03-18-2006, 06:29 AM
Yup, what ElForro said, same deal here.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.