arendt73
asked on
Javascript validation submission page with special field
I need to validate a text field (case_number) in an ASP submission form that contains the following format:
#:##-bk-#####
example: 5:12-bk-12345
or 3:11-bk-99345
Is there anyway that Javascript can validate this specific format? The amount of characters will always be no less than 13, and the : - bk - will always remain a constant.
Any help is greatly appreciated. I attempted the following but it does not work.
Thank you!
#:##-bk-#####
example: 5:12-bk-12345
or 3:11-bk-99345
Is there anyway that Javascript can validate this specific format? The amount of characters will always be no less than 13, and the : - bk - will always remain a constant.
Any help is greatly appreciated. I attempted the following but it does not work.
Thank you!
if (/^[0-9a-zA-z:-]{13}$/.test(theForm.case_number.value)===false)
{
alert("Case Number format is not correct");
theForm.case_number.focus();
return (false);
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER