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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Discussion - re use of input masks 2

Status
Not open for further replies.

MichaelintheUK

Programmer
May 24, 2003
88
GB
I personally find little use for input masks preferring other techniques for data validation. In particular users navigating from field to field using return end up part way into the field or text box.

Am I wrong?

The particular problem I have is the validation of a postcode (UK equivalent of a zip code. Valid codes include

B97 5AA
B5 6YY
BS5 6PP
CV37 6SA

I know you can validate this using string searches or keypress but can you effectively valdidate this using an input mask?

Any suggestions appreciated.

Thanks

Michael
 
Hi Michael,

I agree with what you're saying Michael, but you'll be well aware that string manipulation is notoriously difficult (or at least long-winded) no matter what you are doing with strings.

The problem really lies in the fact that post-codes don't have a 'standard' form.

As is usual in the UK, we adopt 'standards' without any 'future-proofing thought' whatsoever.

I'd have thought that a form such as AAA999 AA99 for EVERY post-code would have been better, where unused digits had a default value such as 'A' for alphabetic and 0 for numeric.

So BB25 6DU would in-fact be BBA025 06DU, with the addition of 3 characters - it would be a simple matter to create a mask.

I'm sure, that when you devise codes within your apps, you have no problems with input masks.

If input mask functionality was discarded, you can be sure that there would be a whole lot more discussion than what will occur in this thread!

Kind regards,

Darrylle







"Never argue with an idiot, he'll bring you down to his level - then beat you with experience." darrylles@totalise.co.uk
 
I've always hated input masks as a users, so I don't use them as a developer.

As for validating data that have no standard pattern, well, that's pretty difficult. I don't know UK post codes, so I don't know any of the rules for validation--or if there even are any. I would go about this like I would go about any other programming task:
-what are the business rules?
-how can they be translated into logical rules?

If there are no rules, is there a place where you can download a list of all (currently) legit post codes? I know this can be done for the US (though I don't currently have any links for sites as I've not needed to do this in years).

Jeremy

==
Jeremy Wallace
AlphaBet City Dataworks
Affordable Development, Professionally Done

Please post in the appropriate forum with a descriptive subject; code and SQL, if referenced; and expected results. See thread181-473997 for more pointers.
 
Thanks Darrylles and JeremyNYC

Thanks for your relies.

I appreciate your comments. I still have doubts about use of input masks. It is just that I am in an environment where colleagues emphasise the need to use them yet I have strong reservations and as you say Jeremy users don't really catre for them either.

Thanks

Michael
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top