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

105
Vistas
How to make a range update a label with the value and move another range on Safari?

I have two range sliders that display the value in the label when they slide. They also adjust each other to prevent a backwards range. It works in FireFox {99.0.1 (64-bit)} (Mac OS) but not in Safari{15.4.1} (iPhone)

           <h6>Age range you prefer</h6>
            <label for="Youngest" id="youngestlabel" class="form-label">Youngest Age: (<?php if(!empty($UserLookingForYoungest)){echo $UserLookingForYoungest;}else{echo "18";}?>)</label>
            <input type="range" class="form-range" id="Youngest" name="Youngest" min="18" max="80" step="1"
                   value="<?php if(!empty($UserLookingForYoungest)){echo $UserLookingForYoungest;}else{echo "18";}?>"
                   onchange="UpdateOldest(this.value)"
                   onmousemove="document.getElementById('youngestlabel').innerHTML='Youngest Age: (' + this.value + ')';">

              <br />
              <label for="Oldest" id="oldestlabel" class="form-label">Oldest Age: (<?php if(!empty($UserLookingForOldest)){echo $UserLookingForOldest;}else{echo "80";}?>)</label>
            <input type="range" class="form-range" id="Oldest" name="Oldest" min="18" max="80"  step="1"
                   value="<?php if(!empty($UserLookingForOldest)){echo $UserLookingForOldest;}else{echo "80";}?>"
                   onchange="UpdateYoungest(this.value)"
                   onmousemove="document.getElementById('oldestlabel').innerHTML= 'Oldest Age: (' + this.value + ')';">

and the javascript:

<script>
function UpdateOldest(newvalue){
 var OldestAge = document.getElementById('Oldest').value;

if(newvalue >= OldestAge){
    updateValue = parseInt(newvalue) + 1;
    document.getElementById("Oldest").value = updateValue;
    document.getElementById('oldestlabel').innerHTML= "Oldest Age: (" + updateValue + ")";
   }};


function UpdateYoungest(newvalue){
var YoungestAge = document.getElementById('Youngest').value;
    if(newvalue <= YoungestAge){
    updateValue = parseInt(newvalue) - 1;
    document.getElementById("Youngest").value = updateValue;
    document.getElementById('youngestlabel').innerHTML= "Youngest Age: (" + updateValue + ")";
   }};
</script>

So, whats the deal with Safari and range sliders?

Thanks!

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