I have three dependent choices. The first one has some meanings.
<select id="first"> <option value="1">v1</option> <option value="2">v2</option> </select>
The second and third are empty:
<select id="second"></select> <select id="third"></select>
I want to fill in empty selections with ajax requests. That's why I am:
jQuery('body').delegate('#first','change',function(){ jQuery.ajax( { 'type':'GET', 'data':{'changed':$('#first').val()}, 'url':'myURL1', 'cache':false, 'success':function(html){jQuery("#second").html(html)}}); return false; });
So everything is fine. The second selection is populated, but ... there is no "change" event to select "second". To get this event, I wrote:
$(document).ready(function() { $('#second').live("change", function() { alert('test'); }); });
But no warning "test" is not visible. How to catch this โchangeโ event for dynamically loaded content for second choice?
x17az source share