New version var price_with_options_ajax_call = function() { $.ajax({ type: 'POST', url: 'index.php?route=product/livepriceupdate/index', data: $('#product input[type=\'text\'], #product input[type=\'hidden\'], #product input[type=\'radio\']:checked, #product input[type=\'checkbox\']:checked, #product select, #product textarea'), dataType: 'json', beforeSend: function() { // you can add smth useful here }, complete: function() { // you can add smth useful here }, success: function(json) { if (json.success) { animation_on_change_price_with_options('#price_special', json.new_price.special); animation_on_change_price_with_options('#price_tax', json.new_price.tax); animation_on_change_price_with_options('#price_old', json.new_price.price); } }, error: function(error) { //console.log(error); } }); } var animation_on_change_price_with_options = function(selector_class_or_id, new_html_content) { $(selector_class_or_id).fadeOut(150, function() { $(this).html(new_html_content).fadeIn(50); }); } if ( jQuery.isFunction(jQuery.fn.on) ) { $('#product input[type=\'text\'], #product input[type=\'hidden\'], #product input[type=\'radio\'], #product input[type=\'checkbox\'], #product select, #product textarea, #product input[name=\'quantity\']').on('change', function() { price_with_options_ajax_call(); }); } else { $('#product input[type=\'text\'], #product input[type=\'hidden\'], #product input[type=\'radio\'], #product input[type=\'checkbox\'], #product select, #product textarea, #product input[name=\'quantity\']').on('change', function() { price_with_options_ajax_call(); }); }