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

119
Vistas
form doesn't show loading

I use a form to upload data:

<form method="POST" action="{{ Route('files.create') }}" enctype="multipart/form-data" onsubmit="event.preventDefault(); showSpinner();">
<!-- ... -->
</form>
<script>
        const showSpinner = () => {
            document.getElementById('btnSubmit').innerHTML =
                'Loading ...';
            document.querySelector('form').submit();
        }
    </script>

If I don't submit the form, I see the loading text. If I do, I don't see it. If I upload a big amount of data, this is annoying because the user has now feedback if it is uploading or not.

How can I show the loading text while the server (?) or client (?) is processing (?) the form?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

you can use this

    var spinner = $('#loader');
$(function() {
  $('form').submit(function(e) {
    e.preventDefault();
    spinner.show();
    $.ajax({
      url: 'filename.php',
      data: $(this).serialize(),
      method: 'post',
      dataType: 'JSON'
    }).done(function(resp) {
      spinner.hide();
      alert(resp.status);
    });
  });
});

also check this click here

about 4 years ago · Juan Pablo Isaza Denunciar
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