'Is there a way in JavaScript to use document.forms for a select tag get a if else compound condition to work
I know you can use document.forms to check if a radio button or checkbox is checked but I am not sure how you could this for a select since it has multiple options.
This is the code I thought I could use. JavaScript:
var pick_deliv = document.forms[order]
[pick_deliv].checked;
HTML:
<form>
<select name="pick_deliv" id="pick_deliv">
<option value="pick_up">Pick up </option>
<option value="delivery">Delivery </option>
</select>
</form
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
