I need to get a check box value in jQuery.
Here is my code:
$(document).ready(function() {
$('input[type="checkbox"]').bind('click',function() {
var tObj = $('#checkpermission');
var tVal = tObj.val();
alert(tVal);
});
});
$query="select * from tbl_user where username!='admin' and password!='admin' order by username limit $eu, $limit";
$result=mysql_query($query);
while($data=mysql_fetch_array($result)) {
<td><INPUT TYPE="checkbox" name="checkuser" id="checkpermission" onclick="changePage()" value='<?=$data[0]?>'></td>
<?php
}
Every time I only get the first value. What am doing wrong?
you can do the following:
Update: Have added check to see whether the checkbox is checked.