[Solved] Form Helper set_value has unexpected results - 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: [Solved] Form Helper set_value has unexpected results (/showthread.php?tid=44113) |
[Solved] Form Helper set_value has unexpected results - El Forum - 08-03-2011 [eluser]Unknown[/eluser] Quote:As I was typing this, I remembered that the set_value function will not work without a validation rule for the field. I set a validation rule and it works perfectly. Since I was 90% through the post when I figured that out, I thought I would share in case anyone else runs into the same problem. I am fairly new to CodeIgniter, so I am probably doing something wrong. I have a form that, when submitted, should return the value that the user entered. Beyond that, I have some default values that I am populating from user preferences. The following is a selection of the code that I am having trouble with: Code: class Ticket extends MY_Controller { A selection from the view is as follows: Code: <?php The problem that I have is with the set_value('assign_to') in the controller. For whatever reason, it doesn't want to work, but the exact same code on the department works flawlessly. If I submit the form and redirect to the index function, the value for assign_to does not get properly set. If I change it to read: Code: $data['data']['selected_assignment'] = it will work perfectly. Any thoughts? |