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
In the example from the plugin docs I have found additional attribute data-countrycodeinput="1"
There is also a part of the code which makes a hidden input if it doesn't exist but it doesn't work for me.
// Add the hidden input for the country codethis.countryCodeInput=$("#"+this.countryInput.attr("id")+"_code");if(!this.countryCodeInput){this.countryCodeInput=$('<input type="hidden" id="'+this.countryInput.attr("id")+'_code" name="'+this.countryInput.attr("name")+'_code" value="" />');this.countryCodeInput.insertAfter(this.countryInput);}
The text was updated successfully, but these errors were encountered:
Interesting. In general, our instructions are that if you want to have the ISO code, you should add the field yourself. I am surprised to see that the code appears to attempt to add it for you.
I'll look into it. In the meantime, just add the field yourself if you want the code.
@mrmarkfrench I was trying to set the country dynamically with using the country name from the backend but it was not working as expected. I had to change the country name to iso2 before being able to achieve that. I added $.fn[pluginName].getIso2FromCountry = function(country) { return countries.find(c => c.name === country)?.iso2 || null; } to get the iso2 before passing it as the defaultCountry. Please let me know your thought if there is already a solution otherwise I make a PR
In the example from the plugin docs I have found additional attribute
data-countrycodeinput="1"
There is also a part of the code which makes a hidden input if it doesn't exist but it doesn't work for me.
The text was updated successfully, but these errors were encountered: