![]() |
Form Validation - set_select - fill from database - 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: Form Validation - set_select - fill from database (/showthread.php?tid=19772) |
Form Validation - set_select - fill from database - El Forum - 06-18-2009 [eluser]Unknown[/eluser] I am working on a form with the help of the form helper. What i wan't to do is using the form validator to validate the form and if the user is editing the form the select box needs to be set from a value that I retrieve from the database. I have used the following code to see if it is going to work but it seem that I am doing something wrong. Code: <select name="primaryFocus"> Code: <select name="primaryFocus"> Both methods echo selected="selected" to every option. Does anyone have a solution for my problem? With Regards, Flex1986 Form Validation - set_select - fill from database - El Forum - 06-18-2009 [eluser]TheFuzzy0ne[/eluser] Welcome to the CodeIgniter forums. Is the form validation class loaded at the top of your controller method. It's quite an easy mistake to make by thinking it's only needed when the form is submitted. |