After stumbling upon this script online, I discovered that it is designed to show/hide text boxes and labels. However, any alterations to the code seem to disrupt its functionality. For instance, changing divpassword will cause it to stop functioning altogether. The current problem lies in the fact that selecting "NO" hides everything thereafter. Is there a way to make it only hide the desired section, and how can I set the checkbox to default to "No"?
<script type="text/javascript>
function DisplayHide() {
var chkYes = document.getElementById("chkYes");
var dvPassport = document.getElementById("dvPassport");
dvPassport.style.display = chkYes.checked ? "block" : "none";
}
</script>
<span>Are you pursuing further education?</span>
<label for="chkYes">
<input type="radio" id="chkYes" checked name="chkEducation"
onclick="DisplayHide()" />
Yes
</label>
<label for="chkNo">
<input type="radio" id="chkNo" name="chkEducation" onclick="DisplayHide()"/>
No
</label>
I attempted to conclude it with or