vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Lock submit button (https://vborg.vbsupport.ru/showthread.php?t=85440)

DWZ 11-27-2002 07:28 AM

Lock submit button
 
I want the "Submit new thread" and "Preview Post" button to lock whenever someone clicks it. I found some JavaScript for a generic form on the internet and tried to get it to work with vBulletin.

The original code was:<script language="JavaScript">
function dis(obj)
{
for(i=0;i<obj.length;i++)
if(obj.elements[i].type == "submit" || obj.elements[i].type == "reset")
obj.elements[i].disabled = true;
}
</script>[/code]I changed that too:[code]<script language="JavaScript">
function dis(obj)
{
for(i=0;i<obj.length;i++)
if(obj.elements[i].type == "submit" || obj.elements[i].type == "preview")
obj.elements[i].disabled = true;
}
</script>

I then added the following just after my body tag:
Code:

<form onsubmit="return dis(this)">
Now, the button locks when you click it, but it wont post the thread or reply, it takes you to some strange URL, for example:

http://localhost/forums/newreply.php...52&attachment=


and the post is never submitted.

Any ideas?

Brad 11-27-2002 07:05 PM

Its pulling other javascript with it when it submits. Ill see if i can tweak it a bit for you.

DWZ 11-27-2002 11:27 PM

cool, thanks :)


All times are GMT. The time now is 10:52 AM.

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.01113 seconds
  • Memory Usage 1,712KB
  • 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
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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