vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Disable "Submit" Button while sending Post? (https://vborg.vbsupport.ru/showthread.php?t=110326)

ElForro 03-14-2006 08:09 AM

Disable "Submit" Button while sending Post?
 
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:

Code:

<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:

Code:

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.


All times are GMT. The time now is 11:05 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01282 seconds
  • Memory Usage 1,722KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete