Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

260
Views
intl-tel-input send hidden input send value to Google sheets

I have an HTML form using intl-tel-input for automatic country detection based on the IP.

I am trying to send the values of the form, but I am getting in Google sheets only the phone number without prefix

<form>
<input type="text" name="first_name" placeholder="First Name">
<input name="phone" type="tel" id="phone" placeholder="phone Number">
<input type="hidden" id="country" name="country">
</form>

this is the JS code

  var input = document.querySelector("#phone");
//   window.intlTelInput(input, {
//     // any initialisation options go here
//   });
  
  var iti = intlTelInput(input, {
  initialCountry: "auto",
  geoIpLookup: function(success, failure) {
    $.get("https://ipinfo.io", function() {}, "jsonp").always(function(resp) {
      var countryCode = (resp && resp.country) ? resp.country : "";
      success(countryCode);
    });
  },
});



var country = $('#country');
var iti = intlTelInput(input.get(0))

// listen to the telephone input for changes
input.on('countrychange', function(e) {
  // change the hidden input value to the selected country code
  country.val(iti.getSelectedCountryData().iso2);
});

Does Google sheets accepts input from hidden fields?

There is any way that I can get the country code separated or at least the full number (country_code+phone_number)

Thank in advance.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!