Here is what I have, in jQuery:
$(document).ready(function(){
$("input[name='DifficultyObtainingCMELicenseRenewal']").change(function() {
$("#DifficultyObtainingCME").toggle(this.value == "Yes");
});
$("input[name='DifficultyObtainingCMEBoardCertification']").change(function() {
$("#DifficultyObtainingCME").toggle(this.value == "Yes");
});
});
Here is the HTML:
<tr>
<th><label>Do you have difficulty obtaining enough CME required for Iowa license renewal?</label></th>
<td>
<label><input type="radio" name="DifficultyObtainingCMELicenseRenewal" value="Yes" class="checkbox"/> Yes</label><br />
<label><input type="radio" name="DifficultyObtainingCMELicenseRenewal" value="No" class="checkbox"/> No</label>
</td>
</tr>
<tr>
<th><label>Do you have difficulty obtaining enough CME required for your specialty board certification/re-certification?</label></th>
<td>
<label><input type="radio" name="DifficultyObtainingCMEBoardCertification" value="Yes" class="checkbox"/> Yes</label><br />
<label><input type="radio" name="DifficultyObtainingCMEBoardCertification" value="No" class="checkbox"/> No</label>
</td>
</tr>
<tr id="DifficultyObtainingCME" style="display:none">
<th class="altTH"><label>Please elaborate on the difficulties you are experiencing:</label></th>
<td class="altTD">
<cftextarea name="DifficultyObtainingCMEOther" rows="3" cols="20"></cftextarea>
</td>
</tr>
So right now if you press “Yes” on one of the boxes it shows the extra field, but then pressing No on the other makes it disappear, and vice versa. How do I make it so, it stays open as long as either one of them is set to “Yes”?
Here is a link: http://jsfiddle.net/madcaesar/hcZXf/
Just make sure either “Yes” option is checked when the change happens:
http://jsfiddle.net/JptF8/