Topic: the submit button multiple clicking issue Pages that link to <a href="https://ozoneasylum.com/backlink?for=10926" title="Pages that link to Topic: the submit button multiple clicking issue" rel="nofollow" >Topic: the submit button multiple clicking issue\

 
Author Thread
patric design
Bipolar (III) Inmate

From: 290 km/h, fast lane, Autobahn, Germany
Insane since: Feb 2001

IP logged posted posted 02-28-2003 11:46 Edit Quote

Cheers fellow designers and coders!

In regards to the old issue of users only supposed to click a form sumbit button only once i have come across a solution that i found on a discussion board.
Whenever i posted a reply and clicked "add reply" once the button would go into its disabled state. "very cool" i thought as i would just like to implement this on a new php+mysql site to prevent accidental duplicates in the database.

i looked into the source - nothing, no onclick=die etc. just a reference to a css class.
i checked on the css class and again - nothing that refers to the state of the button.

any ideas how this can be done? i imageine something like onclick= state: disabled... ???

<´¯`·.¸ Patric ¸.·´¯`>

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

IP logged posted posted 02-28-2003 13:59 Edit Quote

patric design: Hmmmm there are plenty of ways to fix this issue - it came up a while ago in the DHTML forum (and I'll probably move it there). I picked up this code at the time (I think it was from the Doc):

quote:
<script language="javascript">
<!--
var submitcount = 0;

function submitOnce() {
if (submitcount == 0) {
submitcount++;
return true;
}
return false;
}
//-->
</script>



kuckus' Colored Scrollbar utility does some nice work disabling various form elements so you might get some inspiration there:
http://development.gurusnetwork.com/utilities/colored_scrollbars/

___________________
Emps

FAQs: Emperor

kuckus
Bipolar (III) Inmate

From: Berlin (almost)
Insane since: Dec 2001

IP logged posted posted 02-28-2003 18:33 Edit Quote

Thanks for the advertisement Emps

I think a simple

code:
onclick="this.disabled='true';"

in the button's tag should work as well - at least in Mozilla and IE 6 (didn't try other ones yet).

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

IP logged posted posted 02-28-2003 22:16 Edit Quote

Started FAQ:

:FAQ:

___________________
Emps

FAQs: Emperor



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu