Getting the dynamic value of a checkbox in repeating region loop with Jquery

Posted by John on Stack Overflow See other posts from Stack Overflow or by John
Published on 2010-05-07T11:33:39Z Indexed on 2010/05/07 11:38 UTC
Read the original article Hit count: 149

Filed under:
|

How do I get the values of a check box that is in a repeating region with its values dynamically generated from a recordset from the database.I want to retrieve the value when it is checked and after I click on a link.The problem is that it is retrieving only the first value of the recordset which is 1.This is the code:

//jQuery
$(document).ready(function(){
    $("#clickbtn").click(function(){
    $("input[type=checkbox][checked]").each(function(){
            var value=$("#checkid").attr('value');
            $("#textfield").attr('value',value);                     
        });
        return false;
    });
});

//html
<td width="22"><form id="form1" name="form1" method="post" action="">
  <input type="checkbox" name="checkid" id="checkid" value="<?php echo $row_people['NameID']; ?>" />
</form></td>

I would appreciate the help.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about JavaScript