I have my first dropdown with 2 selections: Standard Glass and Tempered glass. I have another dropdown where the user can select the width of the glass.
My problem:
I would suggest having just two selects, then changing the 2nd select based on what is selected in the first.
$('#typeOfGlass').on('change', function(){
$('#glassWidth').html('');
if($('#typeOfGlass').val()==15){
$('#glassWidth').append('');
$('#glassWidth').append('');
$('#glassWidth').append('');
}else{
$('#glassWidth').append('');
$('#glassWidth').append('');
$('#glassWidth').append('');
$('#glassWidth').append('');
}
});
Here is a working example: https://jsfiddle.net/6hmpa1ax/