Been racking my brains over this for a while now, checked the archives,
help docs etc.  I have a ComboBox, and would just like to capture the
default item, even if the user does not select anything in the Combo
box. That way, something is always chosen no matter what the user does.


Currently, my code is:

//( locations_cb is my combobox)
function change(evt){
        evt.target.selected = evt.target.selectedItem.label
}
locations_cb.addEventListener("change", this);

create_btn.onRelease = function(){
        myFunction(locations_cb.selected, [...morevalues])
}

This works, but only as long as something is selected from the combobox.
If nothing is selected by the user, the value gets passed as "[object
Object]" - I understand why if nothing is selected, but how do I
overcome this - by automatically setting something to be selected?  If
so, how?

I tried this when the frame containing my form is loaded:

locations_cb.selectedIndex=0; 

and this: 

locations_cb.selectedItem = myDefaultStringValue;

with no luck, and a million other things based on what I read in the
help files.  I was thinking I could set the selected to be something by
default.  Not sure how to have an item in a combo box selected by
default so a value is always captured.  Thanks.

Jason Merrill   |   E-Learning Solutions   |  icfconsulting.com







NOTICE:
This message is for the designated recipient only and may contain privileged or 
confidential information. If you have received it in error, please notify the 
sender immediately and delete the original. Any other use of this e-mail by you 
is prohibited.
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to