![]() |
PHP Tags not preserved when passing into a View / Validation on dynamically created select control - 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: PHP Tags not preserved when passing into a View / Validation on dynamically created select control (/showthread.php?tid=34026) |
PHP Tags not preserved when passing into a View / Validation on dynamically created select control - El Forum - 09-16-2010 [eluser]osfan[/eluser] Hi Guys, I must be missing something, what I am tring to do is dynamically build a select control to display in my view, simple enough, but I also want to enable validation on the options so that if the user doesn't fill in the form correctly, the value of the select is preserved. This is easy enough if the select control is static, and placed in the view itself, but when I generate the relevant code, and pass it to the view the Php tags seem to get replaced (possibly by &lt; &gt ![]() Code goes like this: Code: $list = $this->example_model->get_examples_list(); The area that I am having difficulty with is Code: <?php= set_select("exampleid", "'.$row->example_id.'"); ?> What I want to pass to a view is options similar to Code: <option <?= set_select("exampleid", "1"); ?> >Example 1</option> Could anyone shed any light, or suggest a better way to achieve my goal please ? Many thanks |