Edit an <option> tag?

Discussion in 'HTML' started by Sims, Mar 4, 2004.

  1. Sims

    Sims Guest

    Hi

    Any help would be greatly appreciated.

    consider the code

    <SELECT NAME="number">
    <OPTION VALUE="1">This is 1
    <OPTION VALUE="2">This is 2
    <OPTION VALUE="3">This is 3
    <OPTION VALUE="4">This is 4
    </SELECT>

    I want to add an item that the user can edit

    <SELECT NAME="number">
    <OPTION VALUE="0"><please enter your text>
    <OPTION VALUE="1">This is 1
    <OPTION VALUE="2">This is 2
    <OPTION VALUE="3">This is 3
    <OPTION VALUE="4">This is 4
    </SELECT>

    So that the user can either select items 1 to 4 or edit a new value.

    Can it be done in html? I want it to be available to most browsers so it
    must be fairly standard.
    If there is no way of achieving the above what would be an elegant way of
    doing it?

    Many thanks
    Simon
     
    Sims, Mar 4, 2004
    #1
    1. Advertising

  2. "Sims" <> wrote:

    > I want to add an item that the user can edit


    In HTML, you cannot. You can just have a select element and in
    input type="text" element, and resolve the issue in the form handler.
    You might consider adding JavaScript that initially hides the input
    field and makes it visible and functional when a particular selection
    is made in the select element. More on this:
    http://www.cs.tut.fi/~jkorpela/forms/combo.html

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
     
    Jukka K. Korpela, Mar 4, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. shruds
    Replies:
    1
    Views:
    882
    John C. Bollinger
    Jan 27, 2006
  2. Julien ROUZIERES

    g++ -pg option and -shared option

    Julien ROUZIERES, Dec 21, 2004, in forum: C++
    Replies:
    1
    Views:
    742
    GianGuz
    Dec 21, 2004
  3. Cas
    Replies:
    5
    Views:
    809
    Kevin Jones
    Aug 28, 2006
  4. Kevin Blount

    page.aspx?option - how to detect "option"

    Kevin Blount, Nov 28, 2006, in forum: ASP .Net
    Replies:
    6
    Views:
    618
    =?Utf-8?B?RWVyYWo=?=
    Nov 28, 2006
  5. John

    Regex for <option> ... </option>

    John, Jan 23, 2009, in forum: Perl Misc
    Replies:
    10
    Views:
    249
    Eric Pozharski
    Jan 29, 2009
Loading...

Share This Page