Tabs & Javascript
Posted: 23 May 2014
Hello,
I have 5 tabs in my form design, I would like to disable 4 tabs until the "Assigned To" user changes PromoStatus to "Approved" or "Complete"....
I am using the following JS code, to disable the 4 tabs, however only the last (ie., 1 gets disabled, the others are still enabled, please help
_________________________________________________
function setMerchTab(){
var v =fd.field('PromoStatus').control().value();
if (v=='Approved' || v=='Complete')
{
$('#fd_tabcontrol-0').tabs('option', 'disabled', null); // Enable
} else {
$('#fd_tabcontrol-0').tabs('option', 'disabled', [4]); // Disable
$('#fd_tabcontrol-0').tabs('option', 'disabled', [3]); // Disable
$('#fd_tabcontrol-0').tabs('option', 'disabled', [2]); // Disable
$('#fd_tabcontrol-0').tabs('option', 'disabled', [1]);//Disable
}
}
fd.field('PromoStatus').change(function(){
setMerchTab();
});
setMerchTab();
________________________________________
Thanks
Avi
I have 5 tabs in my form design, I would like to disable 4 tabs until the "Assigned To" user changes PromoStatus to "Approved" or "Complete"....
I am using the following JS code, to disable the 4 tabs, however only the last (ie., 1 gets disabled, the others are still enabled, please help
_________________________________________________
function setMerchTab(){
var v =fd.field('PromoStatus').control().value();
if (v=='Approved' || v=='Complete')
{
$('#fd_tabcontrol-0').tabs('option', 'disabled', null); // Enable
} else {
$('#fd_tabcontrol-0').tabs('option', 'disabled', [4]); // Disable
$('#fd_tabcontrol-0').tabs('option', 'disabled', [3]); // Disable
$('#fd_tabcontrol-0').tabs('option', 'disabled', [2]); // Disable
$('#fd_tabcontrol-0').tabs('option', 'disabled', [1]);//Disable
}
}
fd.field('PromoStatus').change(function(){
setMerchTab();
});
setMerchTab();
________________________________________
Thanks
Avi