JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css">
<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.js"></script>
<form class="form-horizontal" action="#" method="post" id="additional">
<input type="hidden" name="recid" value="1">
<table class="table table-condensed table-hover table-bordered">
<tr>
<td><strong>Question 1</strong></td>
<td>please answer yes or no to this question</td>
<td>
<div class="controls">
<label class="radio inline">
<input type="radio" name="AE_W4" id="AE_W4Yes" value="Yes" required>Yes </label>
<label class="radio inline">
<input type="radio" name="AE_W4" id="AE_W4No" value="No" required>No </label>
<label for="AE_W4" class="validateError"></label>
</div>
</td>
</tr>
<tr id="adverseEventDetails">
<td></td>
<td>Please enter the description here</td>
<td>
<div class="controls">
<textarea name="AE_Details_W4" id="AE_Details_W4" rows="3" required></textarea>
<label for="AE_Details_W4" class="validateError"></label>
</div>
</td>
</tr>
</table>
</div>
<div class="control-group">
<div class="controls">
<button type="submit" class="btn btn-primary">Continue</button>
<button type="reset" class="btn">Reset</button>
</div>
</div>
</form>
CSS
.validateError {
color: red;
}
JavaScript
$().ready(function() {
// validate the form when it is submitted
$("#additional").validate({
// the rules and/or options for Validate() get listed here,
// and they are separated by commas, not semicolons.
errorClass: "validateError"
});
if($("#AE_W4Yes:checked").length != 0){
// yes is checked... show the dependent fields
$("#adverseEventDetails").show();
}else{
// hide it and blank the fields, just in case they have something in them
$("#adverseEventDetails").hide();
$("#AE_Details_W4").val("");
}
$("#AE_W4Yes").click(function () {
$("#adverseEventDetails").show();
});
$("#AE_W4No").click(function () {
$("#adverseEventDetails").hide();
$("#AE_Details_W4").val("");
});
});