Hi guys,

When i attach an inline onchange event,
<select name="foo" id="foo" onchange="javascript:alert(this.value);">
<option></option>
<option value="1">Come On</option>\
<option value="2">Go On</option>
</select>

and call it like this,
<input type="button" onclick="javscript:$('foo').value=2;$
('foo').onchange();" />

It works in this case.

But...

when i attach the same event this way,
       Event.observe(window, "load", function ()
        {
                $("foo").observe("change", function (){alert(this.value);});
        });
then it does not work. it gives me an error saying, "$('foo').onchange
is not a function".

Is there any solution to get it done?

--~--~---------~--~----~------------~-------~--~----~
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 prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to