Code Bank
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingCode Bank

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old August 27th, 2005, 12:15 PM
shamrog12's Avatar
shamrog12 shamrog12 is offline
Newton's Apple Wizard
ASP Free Intermediate (1500 - 1999 posts)
 
Join Date: Nov 2003
Location: Los Angeles
Posts: 1,661 shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Weeks 2 Days 2 h 39 m 22 sec
Reputation Power: 34
Send a message via AIM to shamrog12
U.S. Zip Code check (modifiable for international) - ASP

zip code must be xxxxx or xxxxx-xxxx

asp Code:
Original - asp Code
  1. <%
  2. function chkZip(zip)
  3.  
  4. dim isZip
  5. zip = trim(zip)
  6.  
  7. set rgObj = new regexp
  8. rgObj.global = true
  9. rgObj.ignoreCase = true
  10. rgObj.pattern = "(\d{5}$|\d{5}-\d{4}$)"
  11. isZip =  rgObj.test(zip)
  12. set rgObj = nothing
  13.  
  14. if len(zip) <> 5 and len(zip) <> 10 then isZip = false
  15.  
  16. if isZip then
  17.     chkZip = true
  18. else
  19.   chkZip = false
  20. end if
  21.  
  22. end function
  23. %>
__________________
If you found a post of mine helpful, please click on the on my post to add to my reputation.


Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingCode Bank > U.S. Zip Code check (modifiable for international) - ASP


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT