Is it possible to type in a new entry to a drop down list?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wendy1
    New Member
    • Jun 2007
    • 1

    Is it possible to type in a new entry to a drop down list?

    Hi,
    i'm rather new at using php..and programming too. So I really need to know if it's possible for users to type in their own entries into a drop down list without getting the data from a database? If yes, how can I code that?
    please help.
    thanks
  • Purple
    Recognized Expert Contributor
    • May 2007
    • 404

    #2
    Hi Wendy,

    The quick answer to your question is no - HTML does not have a drop down list you can edit into..

    That said, it doesn't mean one couldn't be written.

    As a simple work around can you place a text field next to the drop down with a button to add an item to the drop down list ?

    Regards Purple

    Comment

    • shoonya
      New Member
      • May 2007
      • 160

      #3
      If i am getting the question right then you need to create drop by taking option values from user and displaying them in a drop down simultaneously

      you can create such thing using javascript and ajax
      lemme know if i getting your query

      shoonya

      Comment

      • ronnil
        Recognized Expert New Member
        • Jun 2007
        • 134

        #4
        what i usually do
        [code=html]
        <select onchange="docum ent.getElementB yId('textfield1 ').value=this.o ptions[this.selectedIn dex].value">
        <option value="somevalu e">alabel</option>
        <option value="anotherv alue">anotherla bel</option>
        </select>
        <input type="text" name="textfield " id="textfield1 " value="" />
        [/code]

        [Please use CODE tags when posting source code. Thanks! --pbmods]

        select won't be grabbed with the postdata since it has no name, when changing the selectbox, textfield1's value will be updated, but you're still allowed to make a new entry, then just grab the data submitted from textfield1 :)

        Comment

        Working...