goofball1980
12-09-2010, 08:43 PM
Hello
I have the code below and I am trying to add another index id to be checked to the two that I already have. I have tried changing the line:
var anotherTab = (indx.indexOf('a') >= 0) ? id + 'b' : id + 'a';
to
var anotherTab = (indx.indexOf('a') >= 0) ? id + 'b' : id + 'a' : id + 'c';
but I just get a javascript error what would be the correct syntax for a third index id?
var groupId=obj.id.substring(0, 1);
var indx=obj.id.substring(obj.id.indexOf('_')+1);
var id=indx.substring(0, indx.length-1);
var anotherTab = (indx.indexOf('a') >= 0) ? id + 'b' : id + 'a';
document.getElementById(groupId+'tab_' + indx).className = 'selected';
document.getElementById(groupId+'tab_' + anotherTab).className = '';
if (indx==id+'a')
{
show (groupId+'baseballInfo_'+id);
hide (groupId+'footballInfo_'+id);
hide (groupId+'soccerInfo_'+id);
}
else if (if (indx==id+'a')
{
hide (groupId+'baseballInfo_'+id);
show (groupId+'footballInfo_'+id);
hide (groupId+'soccerInfo_'+id);
}
else
{
hide(groupId+'baseballInfo_'+id);
hide (groupId+'footballInfo_'+id);
show(groupId+'soccerInfo_'+id);
}
I have the code below and I am trying to add another index id to be checked to the two that I already have. I have tried changing the line:
var anotherTab = (indx.indexOf('a') >= 0) ? id + 'b' : id + 'a';
to
var anotherTab = (indx.indexOf('a') >= 0) ? id + 'b' : id + 'a' : id + 'c';
but I just get a javascript error what would be the correct syntax for a third index id?
var groupId=obj.id.substring(0, 1);
var indx=obj.id.substring(obj.id.indexOf('_')+1);
var id=indx.substring(0, indx.length-1);
var anotherTab = (indx.indexOf('a') >= 0) ? id + 'b' : id + 'a';
document.getElementById(groupId+'tab_' + indx).className = 'selected';
document.getElementById(groupId+'tab_' + anotherTab).className = '';
if (indx==id+'a')
{
show (groupId+'baseballInfo_'+id);
hide (groupId+'footballInfo_'+id);
hide (groupId+'soccerInfo_'+id);
}
else if (if (indx==id+'a')
{
hide (groupId+'baseballInfo_'+id);
show (groupId+'footballInfo_'+id);
hide (groupId+'soccerInfo_'+id);
}
else
{
hide(groupId+'baseballInfo_'+id);
hide (groupId+'footballInfo_'+id);
show(groupId+'soccerInfo_'+id);
}