GithubHelp home page GithubHelp logo

Comments (3)

iamEAP avatar iamEAP commented on August 29, 2024

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.

CommandLineDesign avatar CommandLineDesign commented on August 29, 2024

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.

iamEAP avatar iamEAP commented on August 29, 2024

Good news is that #55 is in. We just need to update docs/examples.

from jquery.addressfield.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.