Need help to hide a tab
Hello,
I am trying to disable a tab until the user has chose a certain option in a drop down menu. how would i go about programming this?
This is what i have so far however it is not working...
function setPhoneTab()
{
var status = fd.field('Choose_x0020_contact_x0020_optio').control().value();
if (status == 'Letter')
{
$('#fd_tabcontrol-o').tabs('option', 'disabled', null);
}
else
{
$('#fd_tabcontrol-o').tabs('option', 'disabled', [1]);
}
}
var status = fd.field('Choose_x0020_contact_x0020_optio').control().chnage(function()
{
setPhoneTab();
});
setPhoneTab();
I am trying to disable a tab until the user has chose a certain option in a drop down menu. how would i go about programming this?
This is what i have so far however it is not working...
function setPhoneTab()
{
var status = fd.field('Choose_x0020_contact_x0020_optio').control().value();
if (status == 'Letter')
{
$('#fd_tabcontrol-o').tabs('option', 'disabled', null);
}
else
{
$('#fd_tabcontrol-o').tabs('option', 'disabled', [1]);
}
}
var status = fd.field('Choose_x0020_contact_x0020_optio').control().chnage(function()
{
setPhoneTab();
});
setPhoneTab();
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Please, try the following code:
Code: Select all
function setPhoneTab()
{
var status = fd.field('Choose_x0020_contact_x0020_optio').value();
if (status == 'Letter')
{
$('#fd_tabcontrol-0').tabs('option', 'disabled', null);
}
else
{
$('#fd_tabcontrol-0')
.tabs('option', 'active', 0)
.tabs('option', 'disabled', [1]);
}
}
fd.field('Choose_x0020_contact_x0020_optio').change(function()
{
setPhoneTab();
});
setPhoneTab();
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Hi,
Just add conditions for other options to the code:
Just add conditions for other options to the code:
Code: Select all
function setPhoneTab()
{
var status = fd.field('Choose_x0020_contact_x0020_optio').value();
switch (status) {
case 'Option 1':
$('#fd_tabcontrol-0')
.tabs('option', 'active', 0)
.tabs('option', 'disabled', [2]);
break;
case 'Option 2':
$('#fd_tabcontrol-0')
.tabs('option', 'active', 0)
.tabs('option', 'disabled', [1]);
break;
default:
$('#fd_tabcontrol-0')
.tabs('option', 'active', 0)
.tabs('option', 'disabled', [1, 2]);
break;
}
}
fd.field('Choose_x0020_contact_x0020_optio').change(function()
{
setPhoneTab();
});
setPhoneTab();
-
- Information
-
Who is online
Users browsing this forum: No registered users and 14 guests