Tabs & Javascript
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
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Hello,
You should pass indices of tabs which you wish to disable in a single array:
$('#fd_tabcontrol-0').tabs('option', 'disabled', [1,2,3,4]); // Disable
You should pass indices of tabs which you wish to disable in a single array:
$('#fd_tabcontrol-0').tabs('option', 'disabled', [1,2,3,4]); // Disable
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Please, find a sample in the following thread:
viewtopic.php?f=1&t=106#p430
viewtopic.php?f=1&t=106#p430
-
- Posts: 1
- Joined: Fri Mar 27, 2015
Hi,
I have an issue in regards to disabling tabs. The disable works if the tab was not selected, only issue is if I selected tab then do a filter change, the tab doesn't disable at all.
Is this a known issue, and is there a solution where it removes the selection or places it on a default tab selection?
I have an issue in regards to disabling tabs. The disable works if the tab was not selected, only issue is if I selected tab then do a filter change, the tab doesn't disable at all.
Is this a known issue, and is there a solution where it removes the selection or places it on a default tab selection?
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
First, you should switch a tab:
$('#fd_tabcontrol-0').tabs('option', 'selected', 0);
Then disable an inactive tab:
$('#fd_tabcontrol-0').tabs('option', 'disabled', [1]);
$('#fd_tabcontrol-0').tabs('option', 'selected', 0);
Then disable an inactive tab:
$('#fd_tabcontrol-0').tabs('option', 'disabled', [1]);
-
- Information
-
Who is online
Users browsing this forum: No registered users and 13 guests