Disable Second Dropdown Option Based On First Dropdown Selection In Javascript

Javascript Disable Dynamic Dropdown Option Value Onchange Another To get the functionality you're after, you need to hook into the change event on the first dropdown, in order to disable the matching element in the second drop down. I wanted to give the user an additional option when selecting a specific value in one drop down list which would allow the user to provide additional input. the script below does not seem to disable the second drop down menu when "plant machine" is selected in the first drop down menu:.

Jquery Remove Disable Selected Option Selected From First Dropdown On a web page, if you select different options on the first drop down, different options will appear in the second drop down. here is the jquery i have so far: $('#independent').on('change', function (e) { var endingchar = $(this).val().split('').pop(); var selected = $( '#independent' ).val();. Selectelement.queryselector('option[value="' optionvalue.replace( ["\\] g, '\\$&') '"]').disabled = true; the performance depends on the number of the options (the more the options, the slower the first one) and whether you can omit the escaping (the replace call) from the second one.

Javascript How To Disable Dropdown Option Stack Overflow

Javascript How To Disable Dropdown Option Stack Overflow
Comments are closed.