Jump to content

Echo data in Checkboxes


bullbreed

Recommended Posts

Hello

 

When I am editing a product I have some of the data stored as an serialized array in the database.

 

Can I use an echo statement like this

 

value="<?php echo $row["rowname"]; ?>"

 

to make sure checkboxes are already checked relating to the data in the database?

 

If not, how do I do this?

Link to comment
https://forums.phpfreaks.com/topic/192528-echo-data-in-checkboxes/
Share on other sites

To make a checkbox checked, you need to set the attribute checked to "checked":

 

<input type="checkbox" checked="checked" />

 

I wrote a tutorial on working with checkboxes which can be found here: http://www.phpfreaks.com/tutorial/working-with-checkboxes-and-a-database

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.