On Oct 21, 2010, at 6:32 PM, T.J. Crowder wrote:
Instead, I'd do it in the obvious place: The form submit event: http://jsbin.com/aniro4/3 Or you could do it on the `click` event of the button: http://jsbin.com/aniro4/4 (I wouldn't use `mouseup` on the button, in case there are things the user can do that won't trigger the click but *will* trigger `mouseup` -- like pressing down elsewhere, the moving the mouse onto the button and releasing the mouse button. Let's defer to the UA about when the user's actually clicked the button.)
Thanks, TJ, that's about what I had figured. But I have had massive problems with hooking the submit event and modifying the DOM. In about half the cases I've tried this, I end up with one or another browser just not updating the DOM after the submit event has fired. The page sits there with its tongue hanging out, and never updates.
I have tried stopping the submit, then updating the page, then firing this.up('form').submit() or similar, which works, but can then introduce other problems I don't like to fix, like not passing along the clicked submit button, for cases where I include a submit button named delete, and key the form handler's action off of that element's presence at the server.
Everything's a trade-off. Walter -- 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.
