3.2.0

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
August 6,
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
August 6,
The again, I don't see any tags open and close in your javascript, so might i suggest http://www.w3schools.com/
AcidRaZor
August 6,
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
August 7,
bah, change alert("hello")}; to alert("hello");
Mike
August 7,

This topic is archived.

See also:


Back to support forum