select box

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Niall Linden

    select box

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

    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
  • kaeli

    #2
    Re: select box

    In article <52684575.04080 50228.52107051@ posting.google. com>,
    nialllinden@yah oo.com enlightened us with...[color=blue]
    > 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
    >[/color]


    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.



    Comment

    Working...