I have the following code
$(document).ready(function() {
// When change the value in select it will send id to controller in order to return the price of service.
$(".select-service").change(function(){
var element_id = $(this).attr('id');
$.post("/services/get_price_of", {
message: this.value
},
function(data){
$("#" + element_id).parent().find(".price-input").val(data);
})
});
});
The page is loaded with one select but I can add more select dynamically. The problem is that for all select added dynamically, the event early does not work.
Can someone help me?
Regards.
P.D: sorry for my poor english.
use jquery
onhttp://api.jquery.com/on/
As of jQuery 1.7, the .live() method is deprecated