简体   繁体   中英

How to check a checkbox is checked or not if data is receiving from database via a loop

How to checkbox is checked or not when the data is coming from database table using a loop. Here is my code I want to know which checkbox is checked and pass value of checked input.

My Code

Hum, if I understand what you say, you got two solutions : When retriving the data, just remake the query and loop yours data. So, you just have to check the $_POST values with what you put for the input's name.

Second solution, transform yours input's name into an array (name='uni[]'), and just parse this array when getting the form data.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM