commerce.js
commerce.js copied to clipboard
Auto-select county/state field when a postal/zip code is entered that is recognised
Sceario: in a checkout form you've selected United States as your country, and you start typing 94107 into the ZIP code field. It would be cool if the form could auto-select California as the state from the dropdown.
There are a number of things that would be required of Commerce.js to make this happen:
- Awareness of state, in an abstracted way that doesn't depend on any specific frameworks
- An alternative might be to fire events instead of updating state when a state can be resolved. It would be up to the developer to subscribe to these events and connect to their state.
- Awareness of US postal codes, although this could be fetched asynchronously from the Chec API.