Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with PostCode Inpuit Mask?

Status
Not open for further replies.

grobermatic

Technical User
Dec 21, 2002
153
GB
Hi,

I'm trying to figure out what the input mask should be for a post code in the United Kingdom.

I've tried severalm but my users always come up with a real post code which is not allowed by the input mask.

I've tried :

>LL<0#0>LL< - This doesn't work for Postcodes where there is only 1 letter at the start .. i.e for Liverpool where the postcodes are L#

Also some London postcodes are a bit different... WC1 N1AF

Any ideas for a versatile Input Mask which would accommodate all these possiblilties as well as the normal 2 letters 1 number, 1 number 2 letters

Any help would be appreciated

Craig
 
You could have an input mask table. That is a table with a few different input masks stored. This table could be associated with different towns, suburbs. As the users selects the known suburb a known mask is used. If the user selects a new suburb they could be offered a choice of masks to apply. There is a bit of work here to make this user friendly, but it could be done.
 
Hi, did you ever find a solution to this? Apart from the table suggestion, which is not appropriate for clients who want a simple interface!

Thanks
 
You don't have to show your client a complex user interface. With a bit of imagination you can mask it and deal with the complexity in your code.
 
Hi,

With some experimentation, I found that :

LA&&&&C??

works for all postcodes I have come across.

Thanks anyway

Craig
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top