Hi Chris,
When you hook up the handler with Element#observe, it will get passed
the event object as its first parameter (even on IE). Simply call the
stop()[1] method on that object instance, e.g.:
function venFormhandler(event) {
event.stop();
/* ...do your ajaxy goodness... */
}
[1] http://prototypejs.org/api/event/stop
I just noticed that the documentation page uses the older class method
("Event.stop(event)") instead of the newer instance method ("event.stop
()"). Both are still supported and both work; the new form is a bit
shorter.
HTH,
--
T.J. Crowder
tj / crowder software / com
Independent Software Engineer, consulting services available
On Mar 23, 1:12 pm, Chris Sansom <[email protected]> wrote:
> Being a good citizen, I changed:
>
> $('venform').onsubmit = venFormHandler;
>
> to:
>
> $('venform').observe ('submit', venFormHandler);
>
> However, venFormHandler() has a 'return false;' at the end (it runs
> an Ajax script and shouldn't submit the form conventionally), and
> this no longer works. I can't quite figure out what syntax I should
> use with Event.stop in this context.
>
> --
> Cheers... Chris
> Highway 57 Web Development --http://highway57.co.uk/
>
> That's inches away from being millimetre perfect.
> -- Ted Lowe
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" 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/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---