I've build a form but I'm kind of stuck at this thing where I have a yes or no field, and upon selecting yes some of the fields should appear otherwise those should be hidden if the user selects no. I'm not sure how to do it.
Here's the code:
<div class="container">
<h1>Research</h1>
<div class="form-group col-md-3">
<p>Do you have previous research experience? If yes, answer Questions...</p>
<input type="checkbox" name="yes" value="yes">
<label for="yes">Yes</label><br>
<input type="checkbox" name="no" value="no">
<label for="no">No</label><br>
</div>
<div class="form-group col-md-6" style="display: none">
<label for="lengthinresearch">Length of time in Research</label>
<input type="text" class="form-control" id="lengthinreseasrch" name="lengthinresearch">
</div>
<div class="form-group col-md-3">
<p>Type of Research</p>
<input type="checkbox" name="basic" value="basic">
<label for="basic">Basic</label><br>
<input type="checkbox" name="clinical" value="clinical">
<label for="clinical">Clinical</label><br>
</div>
<div class="form-group col-md-6">
<label for="researchinstitution">Research Institution</label>
<input type="text" class="form-control" id="researchinstitution" name="researchinstitution">
</div>
<div class="form-group col-md-6">
<label for="researchmentor">Research Mentor</label>
<input type="text" class="form-control" id="researchmentor" name="researchmentor">
</div>
</div>