I'm trying to get it so that the alert message pops up if the value entered into the textBox is not a decimal number between 0.0 and 4.9 with just one digit before and after the decimal, but the message pops up regardless of what number I entered and I think there's something wrong with my regular expression but I can't figure it out.
if ((textBox.value.search("/^[0-4]\\.[0-9]$/")) == -1) {
alert("Invalid Entry");
return false;
}
The return false is there since if the number is invalid then the function will exit.