Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

262
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda