I have a select with some options in HTML and what I am trying to do is for every different selected option I want to "Unhide" or display another set of options. Hopefully that makes sense. So I have a drop down options like 1, 2 if user select option, i.e. 1, I want to display another drop down menu.
The issue is that upon selection the 2nd drop down menu does not show at all.
The HTML:
<select id="workshop" name="workshop" onclick="return test();">
<option value="">Please select a Workshop</option>
<option value="f">1</option>
<option value="b">2</option>
</select>
<select id="date" name="date" style="display: none">
<option value="">Please select a date</option>
<option value="01/01/01">01/01/01 at 6.30pm</option>
</select>
JavaScript:
function test(){
if(document.getElementById('workshop').value == 'f'){
document.getElementById('date').style.display = 'block';
}
else{
document.getElementById('date').style.display = '';
}
}