I have a form with some dropdowns, and the first selected dropdown will serve to filter the second dropdown\'s choices (to limit them). The following code works just fine in FF
Thanks to @charlietfl for alerting me to the fact that hiding options is not universally supported. Here is the solution I ended up going with:
Here is the actual code:
if(~jQuery(this).attr('id').indexOf('5b0ad35592224') && ~jQuery(this).attr('id').indexOf(jQuery(this).closest('tr').attr('data-id'))) {
var vallie = jQuery(this).val();
var thismenu = menu_portes; // set default menu object
if (vallie === 'Tiroir') {thismenu = menu_tiroirs } else if (vallie === 'Côté') {thismenu = menu_cotes }
var $sub = jQuery('[id*="'+jQuery(this).closest('tr').attr('data-id')+'-field_5b0ad39f92225"]');
$sub.empty(); // remove old options
$sub.append(jQuery('").attr("value", key).text(value)); //append options from my menu object
});
jQuery($sub).val('Choisir'); // set menu to Choisir
};