vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Disable Submit II (https://vborg.vbsupport.ru/showthread.php?t=40940)

psychoxmonkee 07-11-2002 03:53 PM

Disable Submit II
 
You will need to edit the 'NewThread' and 'NewPost' template

This is another version of Xenon's Disable Submit but it disables the buttons instead.

Two steps for each template ;)

Insert the following code anywhere between <head> and </head>
Code:

<script>
function submitonce(theform){
//if IE 4+ or NS 6+
if (document.all||document.getElementById){
//screen thru every element in the form, and hunt down "submit" and "reset"
for (i=0;i<theform.length;i++){
var tempobj=theform.elements[i]
if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset")
//disable em
tempobj.disabled=true
}
}
}
</script>

step two
find:
Code:

onSubmit="return validate(this)"
replace with:
Code:

onSubmit="return validate(this),submitonce(this)"


Works with all vB versions. The buttons just turn grey like you cant click them anymore ;)

Xenon 07-11-2002 04:00 PM

Quote:

Originally posted by psychoxmonkee
This is another version of Xenon's Disable Submit but it disables the buttons instead.
I have made such a Disable Submit Hack?
Very intresting, i didn't know ^^

globalwin 07-11-2002 04:45 PM

sorry for been stupid, but what does it actually do?

Boofo 07-11-2002 05:01 PM

Are you holding out on us again? :)

Quote:

Originally posted by Xenon


I have made such a Disable Submit Hack?
Very intresting, i didn't know ^^


Dean C 07-11-2002 05:01 PM

im confused too... and wouldn't this be a template edit?

psychoxmonkee 07-11-2002 05:22 PM

I guess, but you can take it as a hack.

BigJohnson 07-11-2002 05:36 PM

I am still lost on the purpose of this hack. and yes this is a template edit because there is no PHP files that were hacked. Can you please xplain what it does thanks.

Velocd 07-11-2002 06:01 PM

Quote:

Originally posted by psychoxmonkee
I guess, but you can take it as a hack.
Nah, since it doesn't edit any PHP files, it shouldn't be considered a hack. The correct term is template add-on. And has anyone actually figured out what this does yet, the description is pretty vague. :p

JJR512 07-11-2002 06:19 PM

I think it disables the Submit button after it's been clicked, probably to prevent double-posting. At least, that is my guess, based on the name of the function: "submitonce".

Velocd 07-11-2002 06:32 PM

Well there is already a hack that disables double-posting, by merging your double post with it's previous..I find this method much better.


All times are GMT. The time now is 11:16 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.01152 seconds
  • Memory Usage 1,728KB
  • 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
  • (3)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete