ComboBox

This object type creates a windows-like combobox, a bit like the address bar of Internet Explorer.

Constructor

new ComboBox(sName[,oContainer])
Name Description
sName A string equal to the variable you set the ComboBox to
( sName=new ComboBox("sName") ).
oContainer A reference to the object that should contain the
ComboBox. This eliminates a nasty bug I was running into
with the appendChild method. This parameter is optional,
if you don't specify one, the document.body is used as
the parent.

Properties

Name Description
view Returns a referrence to the actual HTML element (div) of
the ComboBox.
value Returns a string that is the value of the ComboBox.
txtview Returns a referrence to the actual HTML input text box of the
ComboBox.
valcon Returns a referrence to the actual HTML hidden input field of
the ComboBox (which stores the real value).

Methods

Name Description
add(oCmBxIm) Adds one or more ComboBoxItem's to the ComboBox.
toggle() Expand/collapses the ComboBox options list.
choose(text,value) Chooses a new value for the ComboBox and text for
the textbox.
remove(iIndex) Removes an index option at the specified index from
the full ComboBox list.

ComboBoxItem

This object type creates an item for the ComboBox object above.

Constructor

new ComboBoxItem(sText,sValue)
Name Description
sText A string to show the user for the list item.
sValue A string to be the actual value of the list item.

Properties

Name Description
text A string to show the user for the list item.
value A string to be the actual value of the list item.

Methods

Name Description
There are no methods for this object.

Click here to go to the intro page for this object.
Click here to go to the demo page for this object.
Click here to download this object.

Author: Jared Nuzzolillo