3 ms·
ZIP code should be a number pad for every American, but if someone ships or bills to Canada then you have to have the letters. Not much you can do about that, u
by Brendinooo 8y ago
ZIP code should be a number pad for every American, but if someone ships or bills to Canada then you have to have the letters. Not much you can do about that, unfortunately.
- news_to_me 8y agoif (country === countries.US) { input.setAttribute('inputmode', 'numeric'); }
- reificator 8y agoAnd what do you do with the following zip codes? https://en.wikipedia.org/wiki/List_of_ZIP_Code_prefixes#Starts_with_0 https://en.wikipedia.org/wiki/List_of_ZIP_Code_prefixes#Star...
- SAI_Peregrinus 8y agoThat doesn't work. For example, The Hartford Fire Insurance company's address is HARTFORD FIRE INS CO 1 HARTFORD PLZ HARTFORD CT 06115-1703 Note the zip. Leading zero, and the last 4 digits. There are other businesses at the same address, with different zip codes. EG HARTFORD FINANCIAL SERVICES 1 HARTFORD PLZ HARTFORD CT 06115-1709 Etc, etc. Zip codes in the US are text strings, that happen to be composed of the digits 0-9 and a hyphen.
- kevin_thibedeau 8y agoNope. ZIP codes have to support leading zeros which won't happen with a numeric entry. There could also be a hyphenated +4 suffix for pedants. Post codes must always be treated as text.
- learnstats2 8y agoFrom a user input point of view, a numeric keypad or slightly modified numeric keypad would easily suffice. Or, display a numeric keypad as default with a text keypad available. There are better solutions than what is currently offered.
- deleted 8y ago[deleted]
- JdeBP 8y agoThe falsehood that it is correct to treat ZIP codes as one would treat numbers is on the list. * https://mjt.me.uk/posts/falsehoods-programmers-believe-about-addresses/ https://mjt.me.uk/posts/falsehoods-programmers-believe-about... (https://news.ycombinator.com/item?id=5791489 https://news.ycombinator.com/item?id=5791489)