Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

140
Visualizações
deshabilite dos botones después de hacer clic en rechazar/cerrar

Mi tarea es poder deshabilitar los botones aprobar y devolver después de hacer clic en el botón rechazar. El botón Rechazar significa cerrar un proyecto. Estos son mis códigos. ¿Alguien puede ayudarme a descubrir cómo deshabilitar los botones? así es como se ve el botón.

 <div class="text-center "> <button class="btn m-1 align-items-center btn-success text-center " id="approve">Approve</button> <button class="btn btn-danger m-1 align-items-center text-center " id="clear" onclick="sweetalertrejects()">Reject</button> <button class="btn btn-secondary m-1 align-items-center text-center" id="return">Return</button> </div> </div> </div> <script> function sweetalertrejects(){ swal("This button means closing the task. You will not be able to revert this action. Do you wish to continue?", { icon: "info", buttons: { cancel: "Cancel", catch: { text: "Yes, close this task", value: "cancel", }, }, }) .then((value) => { switch (value) { case "cancel": swal("Closed!", "Task has been closed.", "success"); break; default: swal("Task has not been closed."); } }); } </script>
about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

Puede obtener los botones por id y deshabilitarlos de la siguiente manera:

 document.getElementById("approve").disabled = true; document.getElementById("return").disabled = true;

Aquí está el código completo

 function sweetalertrejects(){ swal("This button means closing the task. You will not be able to revert this action. Do you wish to continue?", { icon: "info", buttons: { cancel: "Cancel", catch: { text: "Yes, close this task", value: "cancel", }, }, }) .then((value) => { switch (value) { case "cancel": swal("Closed!", "Task has been closed.", "success").then(()=>{ document.getElementById("approve").disabled = true; document.getElementById("return").disabled = true; }); break; default: swal("Task has not been closed."); } }); }
about 4 years ago · Juan Pablo Isaza Relatório

0

Debe incluir el nombre de clase "deshabilitar" en el botón Aprobar y devolver y su código javascript debería verse así:

 <script> $('#clear').click(function() { swal("This button means closing the task. You will not be able to revert this action. Do you wish to continue?", { icon: "info", buttons: { cancel: "Cancel", catch: { text: "Yes, close this task", value: "cancel", }, }, }) .then((value) => { if(value){ $('.disable').attr('disabled','disabled'); swal("Closed!", "Task has been closed.", "success"); }else{ swal("Task has not been closed."); } }); }); </script>
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda