Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > adding items to a list\menu

Reply
Thread Tools

adding items to a list\menu

 
 
R.G. Vervoort
Guest
Posts: n/a
 
      04-05-2004
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
 
 
 
 
Michael Winter
Guest
Posts: n/a
 
      04-05-2004
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&btn G=Search>

Mike

--
Michael Winter
d (replace ".invalid" with ".uk" to reply)
 
Reply With Quote
 
 
 
 
Matt Kruse
Guest
Posts: n/a
 
      04-05-2004
"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/


 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Removing Menu Items and Child Menu Items Larry Bud ASP .Net 13 01-07-2008 02:12 PM
Recognising Sub-Items and sub-sub items using xslt Ben XML 2 09-19-2007 09:35 AM
Looping through CheckBoxList items doesn't pick up selected ones when items were disabled Bart Van Hemelen ASP .Net 2 09-04-2006 08:35 AM
Items in Outbox not moving to Sent Items Ben Lord Computer Support 0 10-23-2003 08:47 AM
grouping items among a list according to items subtag value Gilles Kuhn XML 0 09-15-2003 12:01 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57