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

124
Vistas
The function that disables a button only takes effect when a function running in parallel with it is active

I have two buttons Start and Next. I want that, initially the Start button is in the enabled state, and the Next button is in the disabled state. After the user clicks on the Start button, a function will run, and when the function is finished, the Next button will switch to the enabled state. I used the following code:

<button id="start" onclick="myfunction1" >Start</button>
<button id="next" onclick="myfunction2" disabled="disabled">Next</button>
<script>
function myfunction1(){
  google.script.run.openUrl();
  document.getElementById("start").disabled = true;
  document.getElementById("next").disabled = false;
}
</script>

When I click on the Start button, the function myfunction1() runs, and at the same time the Start button changes to the disabled state and the Next button changes to the enabled state. However, after the myfunction() function completes, the Start button returns to the enabled state and the Next button returns to the disabled state. I don't know how to solve it. I really need help. 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