Using select box in form help |
[eluser]oldrock[/eluser]
Hi, since i m new to code igniter now i m hardly doing some coding with forms.., so if i use form_select it gives error as call to undefined function . the task i want to do is select some data from the database and i need to populate in the option of the select field.. thanks in advance
[eluser]mi6crazyheart[/eluser]
form_select!!! I afraid , that there is any such form helper function available in CI. May be, i'm wrong but i only got a function "form_multiselect()" in Form helper user manual... User manual: http://ellislab.com/codeigniter/user-gui...elper.html
[eluser]oldrock[/eluser]
Hi Thanks for your reply.., could you please share a piece of example using form_multiselect so that it would be great helpful for me.. Thanks in advance
[eluser]mi6crazyheart[/eluser]
"form_multiselect" is same like "form_dropdown()". Here is an example of "form_dropdown". You can use "form_multiselect" in the same way as it... Code: $options = array( For more info must go through: http://ellislab.com/codeigniter/user-gui...elper.html
[eluser]oldrock[/eluser]
Thanks that helped me well i have fetched value from th database and populated it in the select box with the following code <?php echo form_dropdown('team',$teams); ?> <select name="team"> <optgroup label="0"> <option value="team" selected="selected">Australia</option> </optgroup> <optgroup label="1"> <option value="team" selected="selected">Bangladesh</option> </select> the thing i want to set the value of option field as below dynamically <option value="Bangladesh">Bangladesh</option> help me to do that with the form_dropdown. it would be grate full to me thanks in advance |
Welcome Guest, Not a member yet? Register Sign In |