adding items to a list\menu

Discussion in 'Javascript' started by R.G. Vervoort, Apr 5, 2004.

  1. Ho can i add items to (the item label=visual text and the value=index
    number) a list object on a website.

    I am having a list with 4 items and i would like to add the text from a
    textfield (textfield1.value) to the list object so it will hold 5 items.

    thanks for any suggestions

    Roy
    The Netherlands
    R.G. Vervoort, Apr 5, 2004
    #1
    1. Advertising

  2. On Mon, 5 Apr 2004 20:18:18 +0200, R.G. Vervoort
    <> wrote:

    > Ho can i add items to (the item label=visual text and the value=index
    > number) a list object on a website.
    >
    > I am having a list with 4 items and i would like to add the text from a
    > textfield (textfield1.value) to the list object so it will hold 5 items.


    This has been asked numerous times in the past. See (watch for wrap):

    <URL:http://groups.google.com/groups?num=50&hl=en&lr=&ie=UTF-8&oe=UTF-8&q=adding+select+group%3Acomp.lang.javascript&btnG=Search>

    Mike

    --
    Michael Winter
    d (replace ".invalid" with ".uk" to reply)
    Michael Winter, Apr 5, 2004
    #2
    1. Advertising

  3. R.G. Vervoort

    Matt Kruse Guest

    "R.G. Vervoort" <> wrote:
    > Ho can i add items to (the item label=visual text and the value=index
    > number) a list object on a website.


    I have al ibrary of functions specifically for dealing with select lists,
    and addOption is one of them:
    http://www.mattkruse.com/javascript/selectbox/
    (although that function in particular is rather trivial).

    There are functions there to re-sort the list if you'd want to do that, too.

    Base careful when adding new options - older browsers like Netscape4 will
    not expand the size of the list box, so your new options may not be visible.

    --
    Matt Kruse
    Javascript Toolbox: http://www.mattkruse.com/javascript/
    Matt Kruse, Apr 5, 2004
    #3
    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. Bryan
    Replies:
    1
    Views:
    776
    Steven Cheng[MSFT]
    Mar 1, 2006
  2. gino
    Replies:
    12
    Views:
    1,053
    Keith Wansbrough
    Sep 1, 2004
  3. Larry Bud
    Replies:
    13
    Views:
    7,682
    Larry Bud
    Jan 7, 2008
  4. Microsoft Newsserver

    ASP.NET Menu Items - Dynamic Items Disapearing

    Microsoft Newsserver, Feb 22, 2008, in forum: ASP .Net
    Replies:
    1
    Views:
    393
    bruce barker
    Feb 22, 2008
  5. Mike Tavares

    Adding Access keys to menu items in the Menu control

    Mike Tavares, Dec 23, 2005, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    413
Loading...

Share This Page