observing multiple select menus with prototype
- by snaken
Hi,
I want to observe multiple select menus and respond to their changes using prototype but only the first menu seems to be observed. This is my code:
$('product_options').select('select').invoke("observe","change",optchange);
If there are - for example - 3 selects within product_options then it only observes the first, i thought it might be because of invoke so i then tried this:
$('product_options').select('select').each(function(sel){
$(sel).observe("change",optchange);
});
Still doesnt work though, any ideas whats wrong?