Google Answers Logo
View Question
 
Q: Javascript postcode validator ( No Answer,   0 Comments )
Question  
Subject: Javascript postcode validator
Category: Computers > Programming
Asked by: mesman-ga
List Price: $20.00
Posted: 08 Feb 2005 17:48 PST
Expires: 09 Feb 2005 04:42 PST
Question ID: 471448
Hi, I would like a script to validate the first part of a UK postcode
that separates this portion into its two parts.

I also want the script to confirm the letter(s) used is/are valid i.e.
any of: AB|AL|B|BA|BB|BD|BH|BL|BN|BR|BS|BT|CA|CB|CF|CH|CM|CO|CR|CT|CV|CW|DA|DD|DE|DG|DH|DL|DN|DT|DY|E|EC|EH|EN|EX|FK|FY|G|GL|GU|GY|HA|HD|HG|HP|HR|HS|HU|HX|IG|IM|IP|IV|JE|KA|KT|KW|KY|L|LA|LD|LE|LL|LN|LS|LU|M|ME|MK|ML|N|NE|NG|NN|NP|NR|NW|OL|OX|PA|PE|PH|PL|PO|PR|RG|RH|RM|S|SA|SE|SG|SK|SL|SM|SN|SO|SP|SR|SS|ST|SW|SY|TA|TD|TF|TN|TQ|TR|TS|TW|UB|W|WA|WC|WD|WF|WN|WR|WS|WV|YO|ZE

For example, if I keyed in SW19 (a valid first part of a post code)
The script should return SW and 19 as separate variables.

All the first parts of postcodes are in one of the following forms:

LN, LNN, LLN, LLNN, LLNL

That is to say, the first parts all begin with one or two letters and
end in N or NL. The input field in the form would have a maximum of 4
characters. It should not matter if these are entered in upper or
lower case, and incorrect matches should return false. Examples:

SW1W = True
im89 = True (even though this isn't used)
B200 = False (as there are too many digits)

Hope you get the idea.
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy