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

306
Vistas
setTimeout function not working in iphone Ios14 when submit form

I want to show loading icon in submit input and message alert after submit input is clicked. I use setTimeout() set 3 second show message alert. All browser on computer or phone is ok. But with all browser of Iphone from Ios 12 - 14 not show message alert or icon loading. I guess the error is setTimeout() function.

Could anybody help me?

Here's my code:

    <form id = "commentform">
    <input id="author" name="author" type="text" value="" aria-required="true">
    <input id="email" name="email" type="text" value="" aria-required="true">
    <select name="rating" id="rating">
        <option value=""> Rate… </option>
        <option value="5"> Perfect </option>
        <option value="4"> Good </option>
          <option value="3"> Average </option>
        <option value="2"> Not that bad </option>
        <option value="1"> Very Poor </option>
    </select>
    <textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea>
    <input name="submit" type="submit" id="submit" value="OK">
    </form>


    <script type="text/javascript">
      jQuery(document).ready(function (e) {
       e(document).on("click", "form#commentform #submit", function (t) {
          e("span.empty-review").remove();
          var o = !e("select#rating").val(),
              a = !e("textarea#comment").val();
              b = !e("input#author").val();
              c = e("input#email").val();
              emailReg = /^\w+([\.\-\+]\w+)*\w*@(\w+\.)+\w+$/;
              f = !emailReg.test(c) && c;
          f && e(this).before('<span class="error empty-review">Wrong Email. Try again</span>');
          (o || a || b || c=="") && e(this).before('<span class="error empty-review">Please enter fields with (*). Try again</span>');
          if (o || a || b || c=="" || f) {
             t.preventDefault();
          }else{
              e(this).addClass("rvloading");// add loading icon with CSS
              setTimeout(function(){ alert("Your review sent"); }, 2000);
          } 
      });
      })
    </script>
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