On 27-Jul-07, at 9:45 AM, Karl Guertin wrote:

>> What is the most efficient way to intercept a form submit event?
>> "onsubmit" in the form tag?  "onclick" on the submit button?  Make  
>> use
>> of the connect function?  Something else?  Additionally, I would
>> prefer that this method fail in a way that allowed for a normal  
>> submit
>> to occur if JavaScript were disabled.
>
> connect(formElement,'onsubmit',function(e){
>  console.log(e); //see what's in the Signal event if you don't know
>  return false; //prevent form submission
> });

return false; doesn't do anything here, this should look like:

connect(formElement,'onsubmit',function(e){
     console.log(e); // see what's in the Signal event if you don't know
     e.stop(); // prevent form submission
});

Beau

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