Hide multiple tabs
Posted: 17 Jun 2015
Hi there,
I need to hide more than one tab at the time based in a condition. Here is the code:
var title1 = fd.field('SurveyName').value();
var title2 = fd.field('SurveyName2').value();
var title3 = fd.field('SurveyName3').value();
var title4 = fd.field('SurveyName4').value();
var title5 = fd.field('SurveyName5').value();
var title6 = fd.field('SurveyName6').value();
var title7 = fd.field('SurveyName7').value();
/*Now we need to validate to hide / show tabs*/
if(title1==""){
alert('Title1 Vacio');
$('#fd_tabcontrol-0').tabs('option', 'disabled', [0]);
}
if(title2==""){
alert('Title2 Vacio');
$('#fd_tabcontrol-0').tabs('option', 'disabled', [1]);
}
if(title3==""){
alert('Title3 Vacio');
$('#fd_tabcontrol-0').tabs('option', 'disabled', [2]);
}
if(title4==""){
alert('Title4 Vacio');
$('#fd_tabcontrol-0').tabs('option', 'disabled', [3]);
}
if(title5==""){
alert('Title5 Vacio');
$('#fd_tabcontrol-0').tabs('option', 'disabled', [4]);
}
if(title6==""){
alert('Title6 Vacio');
$('#fd_tabcontrol-0').tabs('option', 'disabled', [5]);
}
if(title7==""){
alert('Title7 Vacio');
$('#fd_tabcontrol-0').tabs('option', 'disabled', [6]);
}
It is only disabling tab [#6], and should hide tabs 2, 3, 4, 5 and 6
Thanks.
I need to hide more than one tab at the time based in a condition. Here is the code:
var title1 = fd.field('SurveyName').value();
var title2 = fd.field('SurveyName2').value();
var title3 = fd.field('SurveyName3').value();
var title4 = fd.field('SurveyName4').value();
var title5 = fd.field('SurveyName5').value();
var title6 = fd.field('SurveyName6').value();
var title7 = fd.field('SurveyName7').value();
/*Now we need to validate to hide / show tabs*/
if(title1==""){
alert('Title1 Vacio');
$('#fd_tabcontrol-0').tabs('option', 'disabled', [0]);
}
if(title2==""){
alert('Title2 Vacio');
$('#fd_tabcontrol-0').tabs('option', 'disabled', [1]);
}
if(title3==""){
alert('Title3 Vacio');
$('#fd_tabcontrol-0').tabs('option', 'disabled', [2]);
}
if(title4==""){
alert('Title4 Vacio');
$('#fd_tabcontrol-0').tabs('option', 'disabled', [3]);
}
if(title5==""){
alert('Title5 Vacio');
$('#fd_tabcontrol-0').tabs('option', 'disabled', [4]);
}
if(title6==""){
alert('Title6 Vacio');
$('#fd_tabcontrol-0').tabs('option', 'disabled', [5]);
}
if(title7==""){
alert('Title7 Vacio');
$('#fd_tabcontrol-0').tabs('option', 'disabled', [6]);
}
It is only disabling tab [#6], and should hide tabs 2, 3, 4, 5 and 6
Thanks.