select box

N

Niall Linden

i have dynamically created select boxes. now i have an onchange method
that is called. eg <select name="textno" onChange="changeText()" >

now my problem is what happens when there is 1 item in the select. the
item is by delault (i think) selectes, ie the box showws the value.
this means that you cannot select it, and because it hasnt vchanged,
the onchange function doesnt work. ive tried the onselect function but
it doesnt work either.

is there any way to call a javascript function if there is only 1 item
in the drop down select when it is highlighted/selected. ideally it
would work for multiple lists

niall
 
K

kaeli

is there any way to call a javascript function if there is only 1 item
in the drop down select when it is highlighted/selected. ideally it
would work for multiple lists


I worked around this issue by always having the first thing in the select be
<option value="">--- select one ---</option>

That way, there are always at least two options.

--
--
~kaeli~
The man who fell into an upholstery machine is fully
recovered.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
 

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

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top