:: Forum >>

if, else in a script

I am trying to set up an if else statment for a tab. But my page will not load in the browser when the "else" statement is added. What am I doing wrong?

tabs.onItemClicked =function(event, index){
var tabValue = tabs.getItemValue(index).toLowerCase();
//alert(tabValue);
var selectedLine = grid.getSelectedRows();

if (tabValue == "info" || tabValue == "note")
input1.setControlText(grid.getCellText(1, selectedLine)); //col, row
input2.setControlText(grid.getCellText(0, selectedLine));
input3.setControlText(grid.getCellText(2, selectedLine));
else; //problem starts here.
alert("hello")};
};
Ira Berkowitz
Sunday, August 6, 2006
if (tabValue == "info" || tabValue == "note")
input1.setControlText(grid.getCellText(1, selectedLine)); //col, row
input2.setControlText(grid.getCellText(0, selectedLine));
input3.setControlText(grid.getCellText(2, selectedLine));
else{ //remove the semi colon and open the tag
alert("hello")};
};
AcidRaZor
Sunday, August 6, 2006
The again, I don't see any tags open and close in your javascript, so might i suggest http://www.w3schools.com/
AcidRaZor
Sunday, August 6, 2006
if (tabValue == "info" || tabValue == "note") {
input1.setControlText(grid.getCellText(1, selectedLine)); //col, row
input2.setControlText(grid.getCellText(0, selectedLine));
input3.setControlText(grid.getCellText(2, selectedLine));
} else{ //remove the semi colon and open the tag
alert("hello")};
}
Mike
Monday, August 7, 2006
bah, change alert("hello")}; to alert("hello");
Mike
Monday, August 7, 2006

This topic is archived.


Back to support forum

Forum search