Hi Kuldeep,

We've just had a very similar question (although that's not
immediately clear from its title), check out this thread:

T.J. Crowder
tj / crowder software / com
Independent Software Engineer, consulting services available

On Apr 7, 9:48 am, kuldeep <kuldeep.rathor...@gmail.com> wrote:
> 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 
For more options, visit this group at 

Reply via email to