php - Issue of retriving data into javascript using checkbox -
ok,i have data retrieve database in table format. check-box there each record. retriving data :
<tr> <td><input name="<?php echo $row['id']; ?>" type="checkbox" class="check"></td> <td><center><?php echo htmlspecialchars_decode($row['id'], ent_quotes); ?></center></td> <td><center><?php echo htmlspecialchars_decode($row['section'], ent_quotes); ?></center></td> <td><center><?php echo htmlspecialchars_decode($row['chapter'], ent_quotes); ?></center></td> <td style="padding-left:25px;margin:15px"><?php echo $_session['question']=htmlspecialchars_decode($row['question'], ent_quotes); ?></center></td> <td><center><?php echo htmlspecialchars_decode($row['correctanswer'], ent_quotes); ?></center></td> <td><center><?php echo htmlspecialchars_decode($row['category'], ent_quotes); ?></center></td> <td><center><a href="<?php echo "update.php?id=".$row['id']."&mode=update";?>"id="dialog_10">update</a></center></td> </tr>
ok, want collect checked value or checked row in javascript storing checkedvalue in stored procedure mysql..but dont understand how ??
maybe
var checkboxvalue = null; var elements = document.getelementsbytagname('input'); for(var i=0; elements[i]; ++i){ if(elements[i].classname==="check" && elements[i].checked){ checkboxvalue = elements[i].value; break; } }
and add value attribute checkbox.
Comments
Post a Comment