Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: UK PostCode
Junior Member

Posts: 4
Registered: 6/14/2007
Member Is Offline
posted on 6/14/2007 at 08:54 AM Reply With Quote
UK PostCode

Hi there,

this is a fantastic script, however is there anyway that i can change the postcode format to check for a UK postcode.

It seems to only validate postcodes in the form of ZIP code ie numerical values.

In the UK the postcode works on AB12 3CD ?


edit to add i found this reg
(GIR 0AA|[A-PR-UWYZ]([0-9]{1,2}|([A-HK-Y][0-9]|[A-HK-Y][0-9]([0-9]|[ABEHMNPRV-Y]))|[0-9][A-HJKS-UW])[0-9][ABD-HJLNP-UW-Z]{2})

how do i incorporate it into the validation script?
View User's Profile View All Posts By User U2U Member

Posts: 2049
Registered: 6/17/2002
Location: US, CO
Member Is Offline
posted on 6/14/2007 at 03:33 PM Reply With Quote

Assuming this regexp is correct you can put it in the validator.js among other formats and make it embedded so you can refer it by assigned name.

example from validator.js:

'alphanum': /^\w+$/,

then you use it as:


or you can use the regexp right in the config

'f': /^\w+$/
View User's Profile View All Posts By User U2U Member

Posts: 1
Registered: 9/27/2009
Location: Brazil
Member Is Offline
posted on 9/27/2009 at 07:36 PM Reply With Quote

To get validate UK postcodes and extended info about them you may find here:
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Product Page Product Page
Product Demonstrations Product Demos
Registration Form Validation
Login Form Validation
Free Download Free Download
Product Documentation Documentation
Documenation Page
Change Log
Validators Comparison Table
Support Forum Support Forum

Go To Top

Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004