Hello,
I have a javascript function that looks at a string value passed to it. It is currently setup to look at the first 2 characters in the string, and if they are equal to a certain string, then do something, if not, do something else. Anyway, I need to change that function to look at the first character and the second character independantly. Kinda confusing, so here is the current function:
function bar_unit(f){
if (Left(f.unit_num.value, 2)=="=W"){
var unit_num = Right(f.unit_num.value, 15);
var unit_num = Left(unit_num, 13);
f.unit_num.value = unit_num;
}
else{
return;
}
}
Now what I want to do is check to be sure the first character is "=", then check the 2nd character and see if it is either A-Z or 1-9. If the first charcter is "=" and the second is "A-Z" OR "1-9", then do the var unit_num part. If either of those conditions are false (being the first "=" or the second is not A-Z or 1-9", then return; Thanks!
Start Free Trial