adding items to a list\menu

R

R.G. Vervoort

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
 
M

Matt Kruse

R.G. Vervoort said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top