Skip to content Skip to sidebar Skip to footer

Make Form Elements Onchange Bubble In Internet Explorer

How do you make the onChange event of various form elements bubble up to the parent form object in Internet Explorer? When select boxes, radio button, ... almost anything ... chang

Solution 1:

I had to use a hack for IE. I manually made all the child form elements trigger the onChange callback rather than have the parent form do it. I wish there was a cleaner solution.

$('myForm').select('input', 'radio', 'textarea').each(
 function(formElement) {
  formElement.observe(
   'change', 
   function() {
    alert('changed');
   }
  );
 }
);

Solution 2:

I think you might have a simple syntax error in your code:

$('myForm') should be $('#myForm')

Post a Comment for "Make Form Elements Onchange Bubble In Internet Explorer"