0

jQuery( document ).ajaxComplete(function() {
   jQuery('#input_5_33 option').removeAttr('selected');
   qty = jQuery('#input_5_24').val();
 var i = 0;
 jQuery('.member_table .gpnf-field:first-child').each(function(){
  not_include = jQuery(this).text();
  if(not_include=='Option 2: Do not include a book'){
   //console.log(not_include);
   i++;
  }
 });
 qty = qty - i;
 console.log(qty);
   if(qty>=1 && qty<=4){
      jQuery('option[value="1 - 4 books: $11"]').prop('selected', true).trigger('change');
   }else if(qty>=5 && qty<=9){
      jQuery('option[value="5 - 9 books: $15"]').prop('selected', true).trigger('change');
   } if(qty>=10){
        jQuery('option[value="10+ books: $20"]').prop('selected', true).trigger('change');
   }else if(qty==0){
     jQuery('#input_5_33 option').removeAttr('selected');
   }		
});

Jagdish Sarma Asked question September 17, 2021
Add a Comment