
August 27th, 2005, 12:15 PM
|
 |
Newton's Apple Wizard
|
|
Join Date: Nov 2003
Location: Los Angeles
|
|
|
U.S. Zip Code check (modifiable for international) - ASP
zip code must be xxxxx or xxxxx-xxxx
asp Code:
Original
- asp Code |
|
|
|
<% function chkZip(zip) dim isZip zip = trim(zip) set rgObj = new regexp rgObj.global = true rgObj.ignoreCase = true rgObj.pattern = "(\d{5}$|\d{5}-\d{4}$)" isZip = rgObj.test(zip) set rgObj = nothing if len(zip) <> 5 and len(zip) <> 10 then isZip = false if isZip then chkZip = true else chkZip = false end if end function %>
__________________
If you found a post of mine helpful, please click on the on my post to add to my reputation.
|