dimanche 2 août 2020

Checkbox checked in loop

while ($row = mysqli_fetch_array($result)){
   if(row[0]=='Not Approve'){
     echo "<input type='checkbox' name='check_approval[]' value='approve'>";}
     }
     if(isset($_POST['check_approval']){echo "checked";}

Hi guys, above is a part of simplified code in my system.
How do i get the 2nd or 3rd checkbox checked.
In this case, if user checked, it will 'checked' everything.
Is there any similar kind of code in php like this -> (check_approval[1]) to get 2nd row to checked.?

From the above example, output will be like [] [] [] [] [] [] []...




Aucun commentaire:

Enregistrer un commentaire