adding items to a list\menu

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • R.G. Vervoort

    adding items to a list\menu

    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.val ue) to the list object so it will hold 5 items.

    thanks for any suggestions

    Roy
    The Netherlands


  • Michael Winter

    #2
    Re: adding items to a list\menu

    On Mon, 5 Apr 2004 20:18:18 +0200, R.G. Vervoort
    <roy.vervoort@r oyvervoort.nl> wrote:
    [color=blue]
    > 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.val ue) to the list object so it will hold 5 items.[/color]

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

    <URL:http://groups.google.c om/groups?num=50&h l=en&lr=&ie=UTF-8&oe=UTF-8&q=adding+sele ct+group%3Acomp .lang.javascrip t&btnG=Search >

    Mike

    --
    Michael Winter
    M.Winter@blueyo nder.co.invalid (replace ".invalid" with ".uk" to reply)

    Comment

    • Matt Kruse

      #3
      Re: adding items to a list\menu

      "R.G. Vervoort" <roy.vervoort@r oyvervoort.nl> wrote:[color=blue]
      > Ho can i add items to (the item label=visual text and the value=index
      > number) a list object on a website.[/color]

      I have al ibrary of functions specifically for dealing with select lists,
      and addOption is one of them:

      (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/


      Comment

      Working...