PDA

View Full Version : Disable Submit II


psychoxmonkee
07-11-2002, 03:53 PM
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>
<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:
onSubmit="return validate(this)"

replace with:

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

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