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.

Xenon 07-11-2002 07:41 PM

hmm, do you think he meant my prevent doublepost hack?
really his expressions aren't really easy to understand then ;)

Boofo 07-11-2002 07:42 PM

I kind of got lost on that one, too. :)

psychoxmonkee 07-11-2002 09:08 PM

=[

Floris 07-12-2002 05:33 AM

Quote:

Originally posted by psychoxmonkee
I guess, but you can take it as a hack.
a code hack = source code modification
a temp hack = nothing
this should be a temp mod = template modification
and shouldn't be published as full release hack (being a source code modification)

lichtflits 09-14-2002 03:58 PM

hey thx, tis works gread.

anyway, it's not a hack but a template edit ;)

lichtflits 09-18-2002 04:52 PM

i found a bug.

when you puch the preview button he submit the thread automatic.
he don't show a preview of the post.

is it posibel to fix this bug?


All times are GMT. The time now is 03:57 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.01178 seconds
  • Memory Usage 1,742KB
  • 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
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (16)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