HighDots Forums  

adding items to a list\menu

Javascript JavaScript language (comp.lang.javascript)


Discuss adding items to a list\menu in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
R.G. Vervoort
 
Posts: n/a

Default adding items to a list\menu - 04-05-2004 , 02:18 PM






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



Reply With Quote
  #2  
Old   
Michael Winter
 
Posts: n/a

Default Re: adding items to a list\menu - 04-05-2004 , 02:31 PM






On Mon, 5 Apr 2004 20:18:18 +0200, R.G. Vervoort
<roy.vervoort (AT) royvervoort (DOT) nl> wrote:

Quote:
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&btn G=Search>

Mike

--
Michael Winter
M.Winter (AT) blueyonder (DOT) co.invalid (replace ".invalid" with ".uk" to reply)


Reply With Quote
  #3  
Old   
Matt Kruse
 
Posts: n/a

Default Re: adding items to a list\menu - 04-05-2004 , 03:42 PM



"R.G. Vervoort" <roy.vervoort (AT) royvervoort (DOT) nl> wrote:
Quote:
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/




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.