0

How to apply readonly inside forloop in checkbox or disabled checked values in checkbox ramaining empty values will be active
any body help me

<input type="checkbox"  class="chkNumberck" value="<?php echo $sub_id; ?>"  
<?php  for($i=0;$i<$count1;$i++) {
if($sub_id1[$i]==$sub_id){
echo "checked"; 
}
}
?> 
/>
2
Contributors
2
Replies
14
Views
2 Years
Discussion Span
Last Post by ramsiva
1
if (isset($_POST['chkNumberck'])) $returnArray=$_POST['chkNumberck'];
else $chkNumberck= array();
$count=5;

echo"<form action='test.php' method='post'>";
for ($sub_id=0 ;$sub_id < $count;$sub_id+=1) 
    {
    echo "<input type='checkbox' name='chkNumberck[]'  value=$sub_id "; 
    if (in_array($sub_id,$chkNumberck)) echo"checked='checked'";>
    }
echo "<input type='submit' /></form>";
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.