Jquery seleziona checkboxes


/ Published in: JavaScript
Save to your folder(s)

Giorgio fecit.
Serve per controllare, a partire da un checkbox, che non ne siano selezionati altri nella stessa riga.


Copy this code and paste it in your HTML
  1. $(document).ready(function (){
  2. $("tr[class=check_unique]").each(function (){
  3. $(this).find("input[type=checkbox]").each(function(){
  4. var selected_name=$(this).attr("name");
  5. $(this).click(function (){
  6. $(this).parents("tr[class=check_unique]").find("input[type=checkbox]").each(function (){
  7. var curr_name=$(this).attr("name");
  8. if(selected_name!=curr_name)document.forms['FORM_INSERT_CENTRI'].elements[curr_name].checked=false;
  9. });
  10. });
  11. });
  12. });
  13. }
  14. );

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.