Make an select with php and put selected |
[eluser]Diegosf93[/eluser]
I´m going crazy i want to create a droplist and show to the user thats one that its save in the db, but i have problems with the php in the view look: Code: <?php Its 100% i have a big error but i´m with this last 3 hours, can you see where i have the error. Sorry for my english.
[eluser]CroNiX[/eluser]
Try using the form helper for that stuff. It will make your life a lot easier.
[eluser]srpurdy[/eluser]
This code is really broken. Not sure where you are intending to get the $valueCat from but this is atleast a bit cleaner code below without the form_helper. Code: <select name="my_select_field">
[eluser]skunkbad[/eluser]
Yeah, use the form helper. Like CI, it's meant to make your job easier. If you are against it, then maybe something like this in a helper: Code: <?php
[eluser]Diegosf93[/eluser]
But the form helper permits put id to the options or only to the select?
[eluser]Diegosf93[/eluser]
[quote author="srpurdy" date="1348530177"]This code is really broken. Not sure where you are intending to get the $valueCat from but this is atleast a bit cleaner code below without the form_helper. Code: <select name="my_select_field"> Thanks this work for me, sorry for the double post! Always good results in this forum! |
Welcome Guest, Not a member yet? Register Sign In |