Hide fields based on choice radio
Posted: 28 Jan 2015
Hi
I am trying to hide some fields based on a choice field - Radio buttons, i used the following code, which works OK on Choice - Dropdown but not on radio?
/ Enable or disable 'Complaint Fields'
function setComplaintTable() {
var p = fd.field('Warranty_x0020_or_x0020_Complain').control().value();
if (p == 'Complaint') {
$('.ext-field').hide(); // Enable
$('.complaint-hide').hide(); // Disable
}
else {
$('.ext-field').show(); // Disable
$('.complaint-hide').show(); // Enable
}
}
// Subscribe on status change
fd.field('Warranty_x0020_or_x0020_Complain').control().change(function () {
setComplaintTable();
});
// Initialize
setComplaintTable();
I am trying to hide some fields based on a choice field - Radio buttons, i used the following code, which works OK on Choice - Dropdown but not on radio?
/ Enable or disable 'Complaint Fields'
function setComplaintTable() {
var p = fd.field('Warranty_x0020_or_x0020_Complain').control().value();
if (p == 'Complaint') {
$('.ext-field').hide(); // Enable
$('.complaint-hide').hide(); // Disable
}
else {
$('.ext-field').show(); // Disable
$('.complaint-hide').show(); // Enable
}
}
// Subscribe on status change
fd.field('Warranty_x0020_or_x0020_Complain').control().change(function () {
setComplaintTable();
});
// Initialize
setComplaintTable();