I need a HTML form that is able to show a drop-down list based on the response selected from the set of radio buttons above it.
For example, my drop-down list ("Food Preference") has two values: "Vegetarian" and "Non-Vegetarian". I will require this drop-down list to only appear if the user selects "Attending" instead of "Not Attending". (Note: Attending & Not Attending is the radio button above the drop-down list).
This is my current codes. Currently it can only capture responses after the submit button is clicked:
<html lang="en">
<head>
</head>
<body>
%%[ var @rsvpresponse, @foodpreference, @submit
set @submit = requestparameter('Submit')
set @rsvpresponse = requestparameter('rsvpresponse')
]%%
<form action="%%=v(@deflandingpage)=%%" method="post">
<br>
<label>RSVP:</label>
<input type="radio" name="rsvpresponse" value="Attending"> Attending
<br>
<input type="radio" name="rsvpresponse" value="Not Attending"> Not Attending
<br>
<label> Food Preference </label>
<select name="foodpreference">
<option value="Vegetarian">Vegetarian</option>
<option value="Non-Vegetarian">Non-Vegetarian</option>
</select>
<br>
<input id="submitted" type="hidden" name="submitted" value="submitted" />
<input type="hidden" name="submit" value="1" />
<input type ="submit" value="Submit">
</form>
</body>
</html>
Does anyone knows how to modify my current script so that it can hide/show the dropdown list based on the user's rsvp selection above and before the submit button is clicked?