7 ms·
Why You Should Use a Text Area for Address Form Fields
- ryantbrown 8y agoChanging the label from "Address 2" to "Apartment, Suite, etc (optional)" and adding dynamic dropdowns for City, State, Country decreased the number of incorrect addresses for us by nearly 50%. Although I can't claim credit I stole it from Shopify's checkout.
- dstroot 8y agoThis approach seems best to me, rather than dealing with free form text and then trying to parse and cleanse that.
- Doxin 8y ago> trying to parse and cleanse that But why would you? If you need to send something to the address you can just print the exact user input on the shipping label.
- quelltext 8y agoYou might wabt to run some analytics on your data based on city, general area, etc. Also simplifies fraud detection.
- kwhitefoot 8y ago> City, State, Country Not all countries have states.
- olooney 8y agoThis is good advice, especially because anyone who is serious about using the address will be passing it through CASS certification or geocoding on the backend before using the address. Such APIs are fully capable of parsing the full address without you splitting the address lines. http://www.datasciencetoolkit.org/ http://www.datasciencetoolkit.org/ https://accuzip.iaccutrace.com/cass/#/app https://accuzip.iaccutrace.com/cass/#/app https://developers.google.com/maps/documentation/javascript/examples/geocoding-simple https://developers.google.com/maps/documentation/javascript/...
- paxy 8y agoThis is especially valid for forms that accept non-US addresses. It is such a pain to deal with assumed formats, length/charset limits or other restrictions put in place by devs who clearly have no idea how addresses work in other countries.
- michaericalribo 8y agoYes, ‘two address lines’ is ad-hoc, but a user’s expectations may also not match the pattern: ‘a multi-line street number, name, apt #, etc; a zip; a city; a state.’ Should we get rid of auto-complete for state and city, using the zip, too, then? I don’t think so. But where to draw the distinction?
- King-Aaron 8y agoRIP devs that need to sanitize address data from random textarea inputs
- egiboy 8y agoIt is virtually impossible to agree on a set of fields - there is always an exception: https://www.mjt.me.uk/posts/falsehoods-programmers-believe-about-addresses/ https://www.mjt.me.uk/posts/falsehoods-programmers-believe-a...
- anotheryou 8y agountil you need to integrate an api needing it seperated with a db full of free text