drop down list ? |
[eluser]buckboru[/eluser]
I am loading a dropdown list. I can successfully load the list on a entry screen. My question is on an update view. How do i make the drop down list to the previously entered value from a data base record. FOr example <td valign="top">System<span style="color:red;">*</span></td> <td><select name="SYSTEM" size 5/> <option value ="RG" selected>RG</option> <option value ="RGT">RGT</option> <option value ="NET">NET</option> <option value ="EXCH">EXCH</option> <option value ="RCRD">RCRD</option> </select> RG is the Default. But suppose the record i'm updating has the value 'NET' How would i make the selected value be 'NET'?
[eluser]Johan André[/eluser]
use the form_dropdown()-function in the form-helper. or use the set_select()-function which is also in the form-helper... Good luck!
[eluser]slowgary[/eluser]
The form helper does this for you. http://ellislab.com/codeigniter/user-gui...elper.html
[eluser]buckboru[/eluser]
OK, i'm making progress now. However, its still not working and i'm not sure why. In the code below, when i run through debug on an 'Update', $selopt shows a value of 'RGT' for the specific record when the echo form_dropdown is executed. However when the page is displayed, it shows a value of 'RG' I cannot figure out what is going on. Any ideas? THanks for any help you can provide. Code: <td><? echo 'System'.' ';?></td> |
Welcome Guest, Not a member yet? Register Sign In |