Rather than use a clumsy if statement, I do this by seeing if the value will match a Regular Expression:
function taskChange() {
var task = $get("ddlTest");
var RegExp = "(^1$^3$^9$^17$^15$)" ;
if (RegExp.match(task.value))
{
// A value of 1,3,9,17,or 15 was selected
// do whatever
}
else
{
//Some other value was selected
// do whatever
}
}
No comments:
Post a Comment