I've got these two dropdowns. I want "select2" options to be dependant of "select1".
Whenever i choose an option-value in "select1" a script should run that checks for all the option-values in "select2" that is lower than the value chosen in "select1" and add the attribute "disabled" to those values.
So for instance, if option "10" is chosen in "select1" then option 3,5,7,8 and 10 should be disabled in "select2". Is this somewhat possible?
<div class="form-group">
<select class="form-control formSelect select1">
<option selected disabled hidden>Choose here</option>
<option>3</option>
<option>5</option>
<option>7</option>
<option>8</option>
<option>10</option>
<option>12</option>
<option>14</option>
<option>16</option>
<option>20</option>
<option>25</option>
<option>32</option>
<option>40</option>
<option>42</option>
<option>50</option>
<option>70</option>
</select>
</div>
<div class="form-group">
<select class="form-control formSelect select2">
<option selected disabled hidden>Choose here</option>
<option>3</option>
<option>5</option>
<option>7</option>
<option>8</option>
<option>10</option>
<option>12</option>
<option>14</option>
<option>16</option>
<option>20</option>
<option>25</option>
<option>32</option>
<option>40</option>
<option>42</option>
<option>50</option>
<option>70</option>
</select>
</div>