Forum Moderators: open
It's really a cool effect. However, if you're using this to prevent a form being submitted twice it's not necessarily a good idea. Sure, it's a good complement to other functions... but it shouldn't be the only thing you rely on.
It's really a cool effect. However, if you're using this to prevent a form being submitted twice it's not necessarily a good idea. Sure, it's a good complement to other functions... but it shouldn't be the only thing you rely on.
Yes it was so a form couldn`t be submitted twice. I`ve coded a guestbook and I wanted to grey the "Sign" button out after it was clicked. I think it would prove useful, so I`ll try some of the ideas listed.
Thanks for the information!
:)
<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"
for (i = 0; i < theform.length; i++) {
var tempobj = theform.elements[i]
if(tempobj.type.toLowerCase() == "submit")
//disable em
tempobj.disabled = true
}
}
}
</script>