Javid Javid - 1 year ago 65
jQuery Question

on change event fires only once

i'm trying to update cart whenever product quantity is changed. but jquery code is stop working after first time updating cart items.

here is jquery code

jQuery(document).ready(function($){
$("input.qty").on('keyup change click',function(){
$('input[name=update_cart]').trigger('click');
});
});

Answer Source

Please try following code.

jQuery(document).ready(function($){
  $(document).on('keyup change click','input.qty', function() {
    $('input[name=update_cart]').trigger('click');
  });
});

let me know if you require further information.