![]() |
Setting radio button values from database for edit form - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Setting radio button values from database for edit form (/showthread.php?tid=19600) |
Setting radio button values from database for edit form - El Forum - 06-12-2009 [eluser]barrysampson[/eluser] Hi, I'm steadily plodding on with my first CI project, and have hit another little problem that has me stumped. User are asked to complete a form which has 30 questions, for which they have to select one of four answers. I have this working just fine, and I'm using serialize() to store the data in the db. I can get the data back out in the right format using unserialize() but I can't work out how to repopulate the edit form using the values I've pulled from the db. I won't post the whole form here, but here's the code I'm using in my submit form to record the answer to 1 of the 30 questions. I'm using a copy of that form to create my edit form but I'm not sure what I need to do to set the radio button values using the the values from the db. Code: <tr align="center"> Thanks for any help you can offer. Setting radio button values from database for edit form - El Forum - 06-12-2009 [eluser]Evil Wizard[/eluser] Code: <tr align="center"> hope that helps Setting radio button values from database for edit form - El Forum - 06-12-2009 [eluser]barrysampson[/eluser] Thanks Evil Wizard. I shall give that a try ![]() Setting radio button values from database for edit form - El Forum - 06-12-2009 [eluser]barrysampson[/eluser] Ok, I know I'm probably missing something really obvious here, but... Now I've looked at this properly I don't get how I pass in the values that I've pulled from the db. Setting radio button values from database for edit form - El Forum - 06-12-2009 [eluser]Evil Wizard[/eluser] I think that's my fault, I must have missed off a line Code: <td> Setting radio button values from database for edit form - El Forum - 06-12-2009 [eluser]barrysampson[/eluser] Ah, now that makes more sense to me (which as I'm such a n00b with CI, is saying something). Thanks again! Setting radio button values from database for edit form - El Forum - 06-12-2009 [eluser]Evil Wizard[/eluser] lol I cant believe I missed off the crucial part of the answer you asked for first time |