showing and hiding a text field based on radio selection - not quite working
Hi,
I have the following jQuery, to show or hide a text field depending upon whether the user click on a yes or no radio button
Its fine to start with, the field is hidden, clicking the "yes" radio shows it, however it doesnt hide again when clicking the "No" button.
any help muxh appreciated
Thanks
Mark
- //Hide the field initially
$("#hide1").hide();
//Show the text field only when the third option is chosen - this doesn't
$('#NHScommssioned input[type=radio]').click(function() {
if ($("#NHScommssioned input[type=radio]").val() == "Yes") {
$("#hide1").show();
}
else {
$("#hide1").hide();
}
});