javascript - Jquery script stops working after ajax response -
i have form 2 select inputs. 2nd select options filtered after first select. jquery event listener first select stops working after ajax response returning list of options second event. testing in dev tools shows ajax request no longer sent after first. reentering script below in console again starts working again. i'm not sure why stops working after ajax request.
my script is:
$('#id_elec_supplier').change(function () { console.log($(this).val()) var supplier = $(this).val() $.ajax({ url: '/users/current_supply/', data: { 'supplier': supplier }, success: function (data) { $('form').replacewith(data) } })})
Comments
Post a Comment