Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Comercial
    • Calculadora

0

42
Vistas
Spinner only on form submit

I would like to show a spinner only after a form has been submitted. How can I achieve this? I have tried using a boolean variable that is stored in the sessionStorage and modified only when the form is submitted and is located at the window load event but the spinner is never shown. The variable dictates whether the spinner is shown or not:

window.addEventListener("load", function () {
   if (sessionStorage.getItem("submitted") === "true") {
      // display spinner here
   }
});

Kindly provide a vanilla js solution not jQuery, Angular etc...

7 months ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

If sessionStorage.getItem("submitted") is a boolean value, it's not "true" but just true without the quotes.

sessionStorage.getItem("submitted") === true
7 months ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos