You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.
addressfield.json is the version which is distributed with addressfield.js. Also note that I needed to capitalize 'Country' in order to avoid the error :
"Uncaught TypeError: Cannot read property 'fields' of undefined"
I have confirmed that addressfield.js and addressfield.json are available and properly accessed. Running this html page results in a form with an unpopulated country dropdown and no functionality.
The text was updated successfully, but these errors were encountered:
Mmm. So it's possible the docs aren't obvious about this, but you need to provide a list of countries yourself.
I suppose it would be reasonable to use the countries provided in the JSON as a fallback if an element is provided for country that is empty, but that'd be a new feature.
You shouldn't need to capitalize the country property; perhaps fixing the above (by providing your own select list of countries) will fix that issue?
Okay that fixed it! Initializing the country dropdown with some valid choices and setting the fields.country object back to lower case did the trick. In my case I do need every from that list so manually populating the select box would not be fun, but I can figure out a way to populate it from addressField.json.
I would recommend putting a few placeholders in that dropdown, maybe like this:
also, I think it would be very cool functionality to populate the country dropdown when it's available but empty and it would take care of this use case which I'm sure will come up again. I'll try my hand at extending addressfield in my fork and see if I come up with something adequate.
Cannot get basic config to work. Consider this example(Mostly taken from docs):
addressfield.json is the version which is distributed with addressfield.js. Also note that I needed to capitalize 'Country' in order to avoid the error :
I have confirmed that addressfield.js and addressfield.json are available and properly accessed. Running this html page results in a form with an unpopulated country dropdown and no functionality.
The text was updated successfully, but these errors were encountered: