I am looking to hide a field within a checkbox options, when an option is selected from another radio button:
ID Info:
field to click
field to hide
I am looking to hide a field within a checkbox options, when an option is selected from another radio button:
ID Info:
field to click
field to hide
Here's a more specific example:
$(document).ready(function () { $('.radiobutton').change(function () { var radiovalue = $('#q1 input:radio:checked').val(); if (radiovalue == "r1") { $('#Field2-0, label[for="Field2-0"]').hide(); $('#Field2-1, label[for="Field2-1"]').show(); $('#Field2-2, label[for="Field2-2"]').show(); } else if (radiovalue == "r2") { $('#Field2-0, label[for="Field2-0"]').show(); $('#Field2-1, label[for="Field2-1"]').hide(); $('#Field2-2, label[for="Field2-2"]').show(); } else if (radiovalue == "r3") { $('#Field2-0, label[for="Field2-0"]').show(); $('#Field2-1, label[for="Field2-1"]').show(); $('#Field2-2, label[for="Field2-2"]').hide(); } else { $('#Field2-0, label[for="Field2-0"]').show(); $('#Field2-1, label[for="Field2-1"]').show(); $('#Field2-2, label[for="Field2-2"]').show(); } }); });
If r1 is selected, cb1 is hidden. If r2 is selected, cb2 is hidden. If r3 is selected, cb3 is hidden.
I would imagine it would be similar to the code in this post: https://answers.laserfiche.com/questions/79437/How-to-select-checkboxes-in-one-field-based-off-of-a-selection-in-another
This helped me to hide the submit button. You could change the Submit to whatever field #q1223 You want to hide, And the Value to whatever value you specified. I would recommend reversing the Hide and show for you case
$(document).ready(function() {
$('.Submit').hide();
$('#q146 input').on('change', function() {
if ($('#q146 input').val() == "Yes") {
$('.Submit').show();
} else {
$('.Submit').hide();
}
});
});