![]() ![]() Here is an example form validation script and it's form. If the zip code entered by the user has an invalid length after non numeric characters are removed, and alert message will pop up. Inside your existing form validation script, you'd use the following code to call the zip code validation function. Simply copy the function to your web document, then call the function in your form validation. The Javascript will remove all non numeric charcters and return the formated zip code. Users may enter alpha characters or non numeric characters in the zip code such as hyphens and or spaces. Suitable for validating US postal codes only. This javascript checks the length of a zip or post code entered into a form and if the length is equal to 9 numeric characters will then format it with a hyphen inserted after the 4th character. ![]() JavaScripts :: Detectors :: Zip Code Validator
0 Comments
Leave a Reply. |