[eluser]Unknown[/eluser]
Alright, so I'm trying to create an edit page for a profile. You access this page by going to /controller/(*)/edit. The wildcard is a database value, and pulls the information and sends it to the view. This is to repopulate the form, obviously.
I'm trying to find out how to repopulate checkbox, and radio inputs though. Text input was as easy as simply adding a default, but these three all take T/F as their default setting, and I'm not really understating exactly how to do this.
Code:
<input type="checkbox" name="protocols[]" value="online" <?php echo set_checkbox('protocols[]', 'online');?> />
TCP/IP (Online Access) <br />
<input type="checkbox" name="protocols[]" value="network" <?php echo set_checkbox('protocols[]', 'network');?> />
Network (Local Area Network) <br />
<input type="checkbox" name="protocols[]" value="splitscreen" <?php echo set_checkbox('protocols[]', 'splitscreen');?> />
Hot Seat (Split-Screen)
Is an example of how my form looks, the database values for this are returned as a string - with the values separated by a comma (i.e. online,network). I have 2; 3 field checkbox sets, a 3 field radio set, and a 9 field checkbox set that I need to repopulate.
Any help would be highly appreciated, thanks.