I didn't actually look at your code (sorry, I'm lazy), but the general
way to solve this is to add something like:
onSubmit="return myFunction();"
to your form tag, and then define a function:
function myFunction(){
  doSomething();
  doSomethingElse();
  if( validateData() && validateSomeMore()){
    return true;
  } else{
    return false;
  }
}

In other words, you just want the "onSubmit" function (which, BTW, you
could also connect to more elegantly using Mochikit's signal library,
instead of onSubmit=) for the form to return false all the time,
except when you are truly ready to submit the form.  If you just want
to stop the form from being submitted multiple times after it's
validated, all you have to do is have your function set a variable,
and if that variable's set, the function always returns false.  For
instance:

var hasBeenSubmitted = false;
function myFunction(){
  if(!hasBeenSubmitted){
    hasBeenSubmitted = true;
    return true;
  } else{
    return false;
  }
}

Hope that helps.

Jeremy

On Aug 19, 12:31 am, Sasha Weberov <[EMAIL PROTECTED]> wrote:
> How can I stop users from submitting the form more then once? I have
> tried onclick="this.disable=true" and
> onclick="this.disabled=true" (notice the disabled) and it doesn't work
> in IE7, I can still submit the form as many times as I want.
>
> Here is my comments js:http://dpaste.com/17243/
>
> Any comments, suggestions, or feedback would be greatly appreciated.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to