Closed MoradHamdy closed 3 years ago
I would be easy to add Currency instead of Country name too. I'm looking forward for the feature to modify the default name.
England is not a country (despite the UK government calling it that out of tradition), it's an administrative region of the country named the United Kingdom.
That said, I'd be happy to see a pull request to allow a client to pass in their own JSON list of "country" values. This would allow you to rename things as you saw fit, to use incorrect names, to eliminate the English (or non-English) version of the country name, or to replace the country name with something else, like currency.
How do you get the full name of a country? rather than the shortcode
How do you get the full name of a country? rather than the shortcode
@iamkarsoft, the two inputs are both submitted with the form. So the first one will have the full name of the country, and the one with "_code" at the end of the ID will have the short code.
@mrmarkfrench i can now get the id. but I want to change the ITI default plugin country based on when the country is changed. don't know what to attach the handler to ? is there a way to solve this?
If you attach an .on("change") handler to the "_code" field, it will fire when that field is updated (and not every keystroke if the user types part of a name into the country name field). That should let you make any changes you want when the user selects a country.
Is there a way to show the country with the corresponding flag on another page after collecting the data? @mrmarkfrench
You could create an instance of the input, set the default value to the selected country, and leave only that country on the list, @iamkarsoft.
The latest version (v2.1.0) now allows you to set the localized name of a country (see the localizedCountries
option, documented on the README). This will allow you to override the names of countries you wish to change.
Assume i have this HTML code:
And this js code:
So how to change for example United Kingdom to England?