Reputation: 61
i cant not use functions in a select loaded in a div with ajax in jQuery , any help? please This is the jQuery code
$("#cbo_sede").change(function () {
var sede = document.getElementById("cbo_sede").value;
var region = document.getElementById("cbo_region").value;
$.ajax({
type: "POST",
url: "salon.php",
data: 'region=' + region + '&sede=' + sede,
success: function (result) {
$("#div_salon").html(result);
}
});
});
Upvotes: 1
Views: 34
Reputation: 57105
Use .on()
Read Event Delegation.
$(document).on("change","#cbo_sede",function(){ ..code here.. });
Syntax
$( elements ).on( events, selector, data, handler );
Upvotes: 2