|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Form Field Selection - Building drop down list
I am building the data input form for an application with several fields that have a defined selection. For these, I am using code similar to the following:
<select name="field name"> <option value="Default Value">Default Value Here</option> <option value="2nd Value">2nd Value</option> <option value="3rd Value">3rd Value</option> </select> this works well except for a single field I need to "populate". What I would like to do is have the users populate this field...if the data entered by the user is not in the option lists, then have the code add it for the next time. My question is can this be done and is so, how? TIA rk |
|
#2
|
|||
|
|||
|
RE: Form Field Selection - Building drop down list
You need to create a table in the db that you can use to dynamically generate your select box. Then when a user types a new selection into the form, you can check that table to see if the selection exists. if it does not, add it to the table. The only con to this approach would be that if the user typed in the same option, but mispelled it, then you would get duplicate entries in the selection. Don't know if I have been clear, but if you have any questions, let me know.
|
|
#3
|
|||
|
|||
|
RE: Form Field Selection - Building drop down list
That would definately be one way to do this!
Basically this is a country list and will be populated with the countries we have done business with. I am using a VALUE="USA" to give us a default of the US and will see how well the other countries get added. Thanks for the suggestion though! |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > Form Field Selection - Building drop down list |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|