Checkbox selection in IF/ELSE depending on radio input choice
Hello everybody, I have a problem :
I have a radio input and I would like that depending on what you choose, it displays another checkbox selection.
Code:
<input type="radio" name="food" value="Breakfast" />
Breakfast
<input type="radio" name="food" value="Lunch" />
Lunch
<input type="radio" name="food" value="Dinner" />
Dinner
I coded this:
<script>
$("input[name='food']").change(function(){
if ($("input[name='food']:checked").val() == 'Breakfast')
{ $("p").show();}
else if ($("input[name='food']:checked").val() == 'Lunch')
{ }
else
{ }
});
</script>
how could I do if I want to insert checkbox selecion into the if/else statements so that if i choose luch it shows me another checkbox selection with other fields??
Thank you so much.