Comments (3)
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?
You can also check out http://tableau-mkt.github.io/jquery.addressfield if you want to start from somewhere with a working form example.
from jquery.addressfield.
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:
<select id="country">
<option value="US">United States</option>
<option value="CA">Canada</option>
<option value="BR">Brazil</option>
</select>
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.
Thanks!
from jquery.addressfield.
Good news is that #55 is in. We just need to update docs/examples.
from jquery.addressfield.
Related Issues (20)
- Name attribute can be dropped during input type conversion in IE8
- Remove GitHub Releases Deploy
- Look into simplifying initialization / configuration
- Trigger an event upon updating fields
- Provide a web component HOT 1
- Multiple addressfields and postal code validation HOT 2
- Licence file states MIT but the javascript file says GPL 2.0 HOT 1
- Docs don't indicate structure of expected markup HOT 1
- Add to bower HOT 1
- Multiple fields and jQuery 1.7 ~ 1.10
- Localization HOT 1
- Install via npm doesn't seem trustworthy HOT 2
- Adding phone number support HOT 4
- Cannot read property 'settings' of undefined HOT 1
- Set selected country HOT 3
- Element changes, data attributes are not carried over HOT 1
- Tests Fail with qunit HOT 1
- Trying to implement jquery.addressfield HOT 1
- Set selected Administrative Area
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquery.addressfield.