3 ms·
I've seen similar issues with postcodes as well, though it seems to have got better: Type "LS29JT" and get an error because it does not like that you did not a
by mytailorisrich 5y ago
I've seen similar issues with postcodes as well, though it seems to have got better:
Type "LS29JT" and get an error because it does not like that you did not add the space "LS2 9JT"
Or even, type "LS2 9JT" and get an error because it does not like that you did add the space.
- iso1210 5y agoThe official postcode format insists on the space between the outward and inward. I'm not sure why. The Inward code is always Number-Letter-Letter. The outward code can be variable length and format. The space is certainly beneficial for visually parsing, but why W11AA isn't valid when W1 1AA is valid is confusing.
- mytailorisrich 5y agoYes the official format includes a space. But since the postcode is unambiguous whether the space is there or not, from an UX point of view just accept either and add the space correctly in the parsing code. Sometimes you can feel that the code has been written by an engineer who is following the 'spec' to the letter instead of thinking of UX.
- iso1210 5y agoIf you were to type W111AA One letter at a time, auto-inserting the space W / W1 / W11 / W11 1 / W11 1A / W11 1AA But for W1, you'd do W / W1 / W11 / W1 1A / W1 1AA Which would be jarring - you don't know when the inward code ends without typing a space, so you have to infer. That said there's no reason not to allow [a-zA-Z0-9 ] and format after typing is finished (onBlur or even after submission). (Poorly implemented address validation in the UK was behind the change in BFPO addresses 10 years ago -- https://fetchify.com/latest-news/lets-talk-about-bfpo-addresses/ https://fetchify.com/latest-news/lets-talk-about-bfpo-addres...)
- mytailorisrich 5y agoAuto-inserting while typing is not a good option, IMO, for the reason you mention, and I tend not to like forms that do this sort of thing. Let the user type in the postcode and when they submit you can parse it as a whole maybe just in the backend, insert the space and display with the space from then on. Simple.
- Symbiote 5y agoI think its to help with manual sorting. Letters received need only have the W1 part read, to see where they should be sent. When they reach Westminster, the 1AA part is read to sort them for final delivery.
- switch007 5y agoThere’s a special place in hell for people who enforce space/no space in a postcode
- 12ian34 5y agoProbably the SO post I visit the most: https://stackoverflow.com/questions/164979/regex-for-matching-uk-postcodes https://stackoverflow.com/questions/164979/regex-for-matchin...
- bmsleight_ 5y agoThat was an absolute delight of a read. I learned a few things. GIR OAA and SAN TA1 are wonderful postcodes.
- janekm 5y agoI used to have a post code like W1F 9XX. That was fun