Page 1 of 1

Drop down list in combination with new entry option

Posted: Fri Oct 18, 2002 1:01 pm
by Mephisto
Hi,

in a form for entering site news I use a drop down list like this:

<select name="topic" size="1" maxlength="24">
<option>Web Design</option>
<option>Home Cinema</option>
<opton>Unreal Tournament</option>
</select>

Using this HTML codes it is not possible to enter new topics, I can only select one of the predefined.

Is there any "HTML control" which allows the input of new values as well as selected one out of a list of predefined ones?

Ciao, Meph

Posted: Fri Oct 18, 2002 4:56 pm
by mydimension
no there isn't. what you could do though is make a seperate text input box for people to write there own topic name. then in the select box make an option read "Other... (specify below)". then if that value is selected you'll know to use the custom value.

nope

Posted: Fri Oct 18, 2002 5:03 pm
by phpScott
the best way to deal with this is to generate the select box out of a database which can be updates as people enter more possible options.
How this would be implemented of course depends on what you are trying to do with the select list.

php and databases oh my oh my what more fun could you ask for. :D

phpScott

Posted: Fri Oct 18, 2002 5:06 pm
by volka
with DHTML you can create an input-text field that overlays the dropdown.
I did this once but it was far from reliable and not worth the whole scripting

Posted: Mon Oct 21, 2002 9:28 am
by Crashin
I also needed something similar and ended up with a PHP/MySQL system. If the end user needed something that wasn't in the list they added to the table, and it was included in the list thereafter. But, it gets more complicated if you need the lists to be user specific. 8)