enrique-alcaraz

Comprobar que checkbox esta seleccionado en jquery

Dec 19th, 2019
2,524
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script type = "text/javascript">
  2.     $('#editar').click(function() {
  3.         if ($('input[name=idservicio]').is(':checked')) {
  4.             return true;
  5.         } else {
  6.             alert('Debe seleccionar un registro');
  7.             return false;
  8.         }
  9.     });
  10. </script>
  11.  
  12. <button id="editar" >Comprobar</button>
  13. <input type="checkbox" name="idservicio" />
Advertisement
Add Comment
Please, Sign In to add comment