I have a form and it is pretty simple. What i want to do is allow the user to fill out the form and select a color and depending on the different color that is selected, a question will reveal varying on its selection.
So here is my HTML:
<form>
<div class="row"><label>Name</label><input type="text" id="name"></div>
<div class="row"><select name="reason" type="select" id="reason">
<option value="red">red</option>
<option value="blue">blue</option>
<option value="green">green</option>
</select></div>
<div id="more">
<div class="row"><label>Why Do you like red</label><input type="text" id="like_red_why"></div>
<div class="row"><label>Why Do you like blue</label><input type="text" id="like_blue_why"></div>
<div class="row"><label>Why Do you like blue</label><input type="text" id="like_blue_why"></div>
</div>
<div ></div>
<div class="row"><label> </label><input type="submit" value="Submit"></div>
</form>
This is my jQuery:
<script>
$(function() {
$('#more').hide();
$('#reason').focus(function() {
$('#more').slideDown();
});
});
</script>
How do i get it so that depending on the selection, a different question will show up.
Thanks.