i've got a reg ex that checks for nos only. i only put numbers in the input box but the code goes into the if statement and displays the alert. can someone shw me what i'm doing wrong? many thnaks
var value = field.value;
var numbers = /[^0-9]/;
if (!numbers.test(value))
{
alert ('in if');
return false;
}
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.