0

i have a code

$("#client").live("change", function() {
    var clientId = $('select[name="client"]').val();
    if(!isEmpty(clientId)){
        batchDropDownPopulate(clientId, "batch");
    }
    $("#client2").val(clientId);
    var listItems = '<option value="">Please select</option>';
    $("#campaign").html(listItems);
});

which i changed to

 $('#client').on('change',  function() {
      var clientId = $(this).select2("val");
    if(!isEmpty(clientId)){
        batchDropDownPopulate(clientId, "batch");
    }
    $("#client2").val(clientId);
    var listItems = '<option value="">Please select</option>';
    $("#campaign").html(listItems);
});

But above code is not populating data or not working. Its not showing any error or not working on change event.

daisy
  • 357
  • 3
  • 7
  • 22

1 Answers1

0

it was small change i wanted to do

 $(document).on('change','#client'  function() {
      var clientId = $(this).select2("val");
    if(!isEmpty(clientId)){
        batchDropDownPopulate(clientId, "batch");
    }
    $("#client2").val(clientId);
    var listItems = '<option value="">Please select</option>';
    $("#campaign").html(listItems);
});
daisy
  • 357
  • 3
  • 7
  • 22