Hi All,
I have a webform with two sections, one with a toggle Yes/No and in the other section i have a 5 fields
i want to hide the section when the toggle is at default "No" and show the section when the switched to "Yes",
the form is hiding at default but not showing when i switch to yes
what am i missing in the code below??
$(document).ready(function () {
debugger;
onDisplaySectionChange();
showHideFieldsandTab();
});
function showHideFieldsandTab() {
$("#callingonbehalfof").change(onDisplaySectionChange);
}
function onDisplaySectionChange() {
if ($("#callingonbehalfof").val() != "Yes") {
$(".section[data-name='Your_Information']").closest("fieldset").show();
$(".section[data-name='Your_Information']").closest('fieldset').find("input[type=text], textarea").val("");
$(".section[data-name='Your_Information']").closest('fieldset').find("select").val('selected');
}
else {
$(".section[data-name='Your_Information']").closest("fieldset").hide();
};
Any help would be great
Many thanks