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

113
Vistas
Correctly Implementing selectMapping with Selectrix

Quick question, struggling with the Selectric implementation on our Autofill function...

can someone give me a quick pointer on how the correct syntax looks like?

var select = document.getElementById("selectAddress"),
                    street = document.getElementById("streetInput"),
                    city = document.getElementById("cityInput"),
                    postal = document.getElementById("postalInput"),
                    state = document.getElementById("stateInput");
                    country = document.getElementById("countryInput")
                    language = document.getElementById("language")
                    apiForm = document.getElementById("apiform")

                    console.log(apiForm)
                    
                var mapping = {
                    "1": { 'sampleStreet': "Heilsbronner Strasse 4", 'sampleCity': "Neuendettelsau", 'samplePostal': "91564", 'sampleState': "Bayern", 'sampleCountry': "de" },
                    "2": { 'sampleStreet': "1600 Pennsylvania Avenue", 'sampleCity': "Washington", 'samplePostal': "20500", 'sampleState': "Washington D.C.", 'sampleCountry': "us" },
                    "3": { 'sampleStreet': "Champ de Mars 5 Av. Anatole", 'sampleCity': "Paris", 'samplePostal': "75007", 'sampleState': "Paris", 'sampleCountry': "fr" },
                    "4": { 'sampleStreet': "1 Queen's Rd W", 'sampleCity': "Hong Kong", 'samplePostal': "Neuendettelsau", 'sampleState': "Hong Kong", 'sampleCountry': "hk" },
                };

                select.addEventListener("change", function () {
                    var selectedMapping = mapping[select.value];

                    if (selectedMapping) {
                        street.value = selectedMapping.sampleStreet;
                        city.value = selectedMapping.sampleCity;
                        postal.value = selectedMapping.samplePostal;
                        state.value = selectedMapping.sampleState;
                        $(country.value(selectedMapping.sampleCountry)).selectric("refresh");
                    } else {
                        street.value = 
                        city.value = 
                        postal.value = 
                        state.value =
                        postal.value = null
                        $(country.val(null).selectric("refresh"));
                    }
                });
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