On Nov 14, 12:35 am, Matt Foster <[EMAIL PROTECTED]> wrote:
> First things first right?
>
> So we need to attach a change event handler to the form, unfortunately
> in my experiences IE did not play nice with this and did not catch the
> bubbling event of an input's change event by observing the form,
There is no onchange intrinsic event defined for form elements in the
W3C HTML specification, nor is it part of the unspecified "DOM 0"
stuff, so you can't expect a browser to imlement it.
> it does in FF
Which might be convenient if you are coding *only* for browsers that
implement it but not otherwise.
> and that way makes sense but I've had to iterate over all
> of the form.elements and attach the listener explicitly.
Presumably you are attaching a handler for the change event, which is
what Form.EventObserver does (more or less).
>
> $A(form.elements).each(function(element){
>
> Event.observe(element, "change", someFunc);
Which depends on the onchange event firing before the unload event
occurs, which it frequently does not. Using the change event also
doesn't help to determine whether the form has changed from its
default state, it only tells you if a control has changed since it got
focus. Where the use of onchange is necessary, it is more useful to
use the click event for radio and checkbox controls (as does
EventObserver) because of the differences between when browsers fire
the change event for those elements.
The bottom line is that using onchange to intercept unload simply
doesn't work reliably.
--
Rob
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" 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/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---