-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to set the country code when opening a popup from edit link of a grid? #695
Comments
I'm sorry, I'm totally confused. You say you want to retrieve the country code, and yet you're calling |
I have updated the details above, hope this helps in understanding the issue |
Thanks. It seems in step 3 the plugin is in a broken state, with a grey flag - I'd like to solve this problem first. Please can you post the JS that you're using to initialise the plugin when the modal is opened. And tell me exactly what the phone number value is that you're setting in the input (does it include the international dial code?), and tell me how you're setting it - do you put the value in the input before you init the plugin, or do you call Oh I just noticed from the table that under the "contact" column, you have the number starting 718. As mentioned in the readme, I highly recommend you store numbers in the full international format (which you can get from calling |
What do you mean when you say you are not able to get the code? What are you trying to do? In your screenshots it looks like the country is being selected correctly now. If you want to get the currently selected country data you can use |
I want to display the country for which I have saved the contact. For example, I have a number saved for UK as +447113456789 which is displayed in the row and I click on edit button of the grid for that respective row the modal pop-up opens but the country code is set as US by default which should be UK. As per your suggestion, I tried using getSelectedCountryData method as well. |
Haha this is all so confusing. Let's please stick to this one example of a UK number which includes the intl dial code. Please show me the code you're using to init the plugin when you open the modal, and a screenshot of the modal once the plugin has initialised. |
Doc2.docx |
I think you also need to save "iso2" to database.So you can set country when you edit like iso2 is country code from your database. |
@swapnilgopal I can't read docx files. Please paste the code here directly. |
In your ajax success callback, you're setting the phone number input value directly. Instead you should use the plugin's |
@swapnilgopal How were you able to get this to work in a mobile |
@swapnilgopal Please update your code on ajax success like |
You can use the option: hiddenInput: Inject a hidden input with this name, and on submit, populate it with the result of getNumber. |
Can i get the full code |
Hello swapnilgopal index.html
|
@jackocnr Excuse me, exist some way to change the dial code that appears in the dropdown? for example: instead of "+56" could be "+569" to Chile. |
$('.country').each(function () { |
Hi @jackocnr, Thank you for this wonderful plug-in! I am using this on a salesforce communities page. I have a list of countries and one of them is missing in intl-tel-input. How can I add them + their flags? |
@ask4alikhan your question is off-topic, please create a new issue for this. |
IMPORTANT: please note that the autoFormat feature (format-as-you-type) was removed in v8.0.0 - read more here: #346. Please do not open any new issues about this topic.
IMPORTANT: we use libphonenumber for formatting and validation - if your issue relates to one of these things, please check their test site first and if you see the problem there please file an issue with them instead: https://rawgit.com/googlei18n/libphonenumber/master/javascript/i18n/phonenumbers/demo-compiled.html
Steps to reproduce
I am able to save the country code in database from a form
I have a grid where there is a Edit button which opens a modal popup where I want to retrieve the country code
On click of edit the below pop-up opens up:
Need to get the country code on the modal popup for the row that I select.
Expected behaviour
Want to display the country code against each record
Actual behaviour
Not able to display the country code with
$("#inputContact").intlTelInput("setCountry", $ ("#inputCountryCode").val());
I need to call this on click of edit but it gives ".intlTelInput() is not a function" and only gets recognized on load.
Initialisation options
List any options you're using e.g. utilsScript or preferredCountries
The text was updated successfully, but these errors were encountered: