How to create a conditional argument if one or more items are selected
from a selectbox?
If I have the following selectbox:
<select id="a1" multiple>
<option>Apple</option>
<option>Banana</option>
<option>Carrot</option>
<option>Dates</option>
<option>Eggs</option>
<option>French fries</option>
</select>
what is the proper way to write a conditional if / else statement such
that certain functions are executed only if some items are selected.
Meaning: if Apple or Banana selected, then 'if' condition #1 is met and
code fires
but if Carrot or Dates or Eggs selected, then 'if' condition #2 is met and
different code fires
etc
No comments:
Post a Comment