you could use a regular expression.
this checks for the value having 5 digits or starting with 5 digits followed by a hyphen (-) then 4 digits
Code:
function isZipCode(value) {
var RegExp = /^\d{5}([\-]\d{4})?$/;
return (RegExp.test(value));
}
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
|