Hide or show Tab with checkboxes (allow multiple selections)
Posted: 10 Apr 2015
Hi all:
I create a form that contains four tabs. Tab 0 must show a field (test1) with four checkboxes (allow multiple selections). Depending on the button that is chosen, one of the other tabs must be hide or show. I made this script but only works with Radio Buttons not for multiple selections.
Can you help me?
Thanks
Pablo
function setResourceTab()
{
var status = fd.field('test1').value();
switch (status) {
//Caso0:Resource1
case 0:
$('#fd_tabcontrol-0')
.tabs('option', 'active', 0, 4)
.tabs('option', 'disabled', [2, 3]);
break;
//Caso1:Resource2
case 1:
$('#fd_tabcontrol-0')
.tabs('option', 'active', 0)
.tabs('option', 'disabled', [1, 3, 4]);
break;
default:
$('#fd_tabcontrol-0')
.tabs('option', 'active', 0)
.tabs('option', 'disabled', [1, 2, 3, 4]);
break;
}
}
fd.field('test1').change(function()
{
setResourceTab();
});
setResourceTab();
I create a form that contains four tabs. Tab 0 must show a field (test1) with four checkboxes (allow multiple selections). Depending on the button that is chosen, one of the other tabs must be hide or show. I made this script but only works with Radio Buttons not for multiple selections.
Can you help me?
Thanks
Pablo
function setResourceTab()
{
var status = fd.field('test1').value();
switch (status) {
//Caso0:Resource1
case 0:
$('#fd_tabcontrol-0')
.tabs('option', 'active', 0, 4)
.tabs('option', 'disabled', [2, 3]);
break;
//Caso1:Resource2
case 1:
$('#fd_tabcontrol-0')
.tabs('option', 'active', 0)
.tabs('option', 'disabled', [1, 3, 4]);
break;
default:
$('#fd_tabcontrol-0')
.tabs('option', 'active', 0)
.tabs('option', 'disabled', [1, 2, 3, 4]);
break;
}
}
fd.field('test1').change(function()
{
setResourceTab();
});
setResourceTab();