Add an item to an Options List.

B

bruce

When using a combobox, I want to add a new item to the dropdown box
but typing the item in the display box. I can do this with Java. Can I
do it with JavaScript?

Thank you..

Bruce
 
J

Jukka K. Korpela

When using a combobox, I want to add a new item to the dropdown box
but typing the item in the display box. I can do this with Java. Can I
do it with JavaScript?

It depends on what you mean by "the display box" and by "typing the
item" in it - the latter expression is now homeless, maybe you meant to
write "by" instead of "but".

It's also quite possible that you really mean something different from
what you write. What would it help to add an item to an "Options List"
(which probably means the collection of <option> elements inside a
<select> element) that way? If you wish to allow free text input, why
don't you just do that, with <input type=text>?
 
S

Scott Sauyet

When using a combobox, I want to add a new item to the dropdown box
but typing the item in the display box. I can do this with Java. Can I
do it with JavaScript?

HTML does not have a ComboBox control, only a SELECT element which can
be used as a multi-select.

You'd have to roll your own, or find one of the myriad widget
libraries that does what you like.

-- Scott
 
B

bruce

HTML does not have a ComboBox control, only a SELECT element which can
be used as a multi-select.

You'd have to roll your own, or find one of the myriad widget
libraries that does what you like.

  -- Scott

Thanks for the response. Something tells me that in my younger days, I
superimposed a text box and using the keydown event. But, this thought
is so vague in my mind I don't recall how I did it. IT might even have
been using VB?

Oh, well, I'll have to come up with something else using JS.

Bruce
 
B

bruce

It depends on what you mean by "the display box" and by "typing the
item" in it - the latter expression is now homeless, maybe you meant to
write "by" instead of "but".

It's also quite possible that you really mean something different from
what you write. What would it help to add an item to an "Options List"
(which probably means the collection of <option> elements inside a
<select> element) that way? If you wish to allow free text input, why
don't you just do that, with <input type=text>?

You're correct. My description was bad. I;m now trying to develop
something along the lines that you have suggested with the <input
type=text>.

Thanks...
 

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,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top