On Apr 4, 2011, at 2:37 PM, Joschi Cassel wrote:
Question, Let's say you had a div / table with multiple inputs, do
you manually set the onblur for each input or "observe" from the
form, div?
It's kind of risky to try to observe the blur event from above the
element, because IE has serious trouble with bubbling form inputs. The
Form.Element.Observer and Form.Observer frameworks are there to work
around this problem. Have a look through the documentation.
If you wanted to do this yourself in an unobtrusive manner, you could
set an observer on each element long-hand, like this:
document.observe('dom:loaded', function(){
['field1','field2','field3'].each(function(elm){
$(elm).observe('blur',function(evt){
//do your stuff here,
//this == your element,
//evt == the blur event
});
});
});
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.