Just catch it

if(e) {
        e.stop();
        { 

-----Original Message-----
From: Rodrigo [mailto:[email protected]] 
Sent: Thursday, 30 July 2009 1:49 PM
To: MooTools Users
Subject: [Moo] Re: submit event not caught using
onchange="$('formID').submit();"


Steve,
Thanks for the reply!

That does make sense but now I'm getting the following error when I
fire the onchange:

e is undefined on e.stop();

On Jul 29, 10:58 pm, "Steve Onnis" <[email protected]> wrote:
> Rodrigo
>
> You need to use the fireEvent() function so your onChange would be
>
> <select name="ColumnName"
> onchange="$('ItemEditFormID').fireEvent('submit');">
>
> Steve
>
> -----Original Message-----
> From: Rodrigo [mailto:[email protected]]
> Sent: Thursday, 30 July 2009 12:50 PM
> To: MooTools Users
> Subject: [Moo] submit event not caught using
>
> onchange="$('formID').submit();"
>
> I have the following script:
>
> $('ItemEditFormID').addEvent('submit', function(e) {
>                                         e.stop();
>                                         this.set('send', {
>                                                 onComplete:
> function(response) {
>
> $('panel1').set('html', response);
>                                                 }
>                                         });
>                                         // Send the form.
>                                         this.send();
>                                 });
>
> And the following form:
>
> <form id="ItemEditFormID" method="post" action="/MyLocalv2/Dashboard/
> filters/filterItemEditPopulate.cfm">
>   <select name="ColumnName" onchange="$('ItemEditFormID').submit();">
>         <option value="etc">etc</option>
>   </select>
>   <input type="submit" value="save" />
> </form>
>
> Whenever I click the "submit" button, the form submission is stopped
> via e.stop();
> But if I change the select (triggering the onChange event), the
> submission is not stopped.
>
> Is there a different way of stopping a submission event when triggered
> by an onChange?
>
> Thx
>
> Rodrigo

Reply via email to