Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

250
Views
¿Cómo deshabilitar el botón de forma permanente después de hacer clic, los botones creados a partir de los datos del servidor mediante bucles?

Tengo una lista de botones en una página que se crea usando una base de datos, me gustaría deshabilitar el botón de clic del usuario de forma permanente. El botón también debe estar en modo desactivado después de cargar la página.

 <div class="panel-group" id="posts"> <?php while($row = $query->fetch(PDO::FETCH_ASSOC)) { ?> <button id='registedButton' type='button' onclick='getButtonDataId(this)' data-id=<?php echo $row["Acronym"]; ?>>Applied</button> }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

<div class="panel-group" id="posts"> <?php while($row = $query->fetch(PDO::FETCH_ASSOC)) { ?> <button id='registedButton_<?php echo $row["Acronym"]; ?>' type='button' class="registedButton" data-id=<?php echo $row["Acronym"]; ?>>Applied</button> <?php } ?>
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <script> $(document).ready(function(){ $(".registedButton").each(function() { var getCookieName = $(this).attr('id'); if(getCookie(getCookieName)){ $(this).prop('disabled',true); } }); }); $('.registedButton').on('click', function(e) { var cookieName = $(this).attr('id'); var eCookie = setCookie(cookieName, 'setVal'); e.preventDefault(); $(this).prop('disabled',true); }); </script>
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!