Hello Friends,
I have checkbox which is generated dynamically. Here the code is :
<?php
$i=0;
while($row1 = mysql_fetch_array($result))
{?>
<label><?php echo $i++ ?><input type="checkbox" name="chk_list[]" value="<?php echo $row1['Veh_id'];?>" class="txt" onClick=""><?php echo $row1['Veh_nm']; ?></input></label></br>
<?php }
?>
Now, I want to insert IDs and related information which checkboxes are checked. So, I tried small javascript on button when its clicked.
function validate()
{
var chk = document.frm.chk_list;
//alert (chk);
for(i=0; i<chk.length; i++)
if(chk[i].checked==true){
alert (chk[i].value);
}
}
now thing is how can I access this value in PHP? Is there any trick to pass array from javascript and use them in PHP code??
Thanking You,
Hakoo Desai.