Index | OAT homepage | OpenLink Software

# OATDOCcombobox

- OATDOCcombobox
- _ _ combobox.js
- _ _ _ _ Objects
- _ _ _ _ _ _ OAT.Combobox(defaultValue)
- _ _ _ _ Methods
- _ _ _ _ _ _ OAT.Combobox::addOption(element, textValue)
- _ _ _ _ CSS classes
- _ _ _ _ _ _ .combo_box
- _ _ _ _ _ _ .combo_box_list
- _ _ _ _ _ _ .combo_box_value
- _ _ _ _ _ _ .combo_image
- _ _ _ _ Example

## combobox.js

Creates a combobox, an enhanced `<select>` which allows richer options.

### Objects

#### OAT.Combobox(defaultValue)

Creates a combobox with a value of `defaultValue` . Its main div is accessible as `OAT.Combobox::div` . Onchange callback may be set via `OAT.Combobox::onchange` property.

### Methods

#### OAT.Combobox::addOption(element, textValue)

Adds a new option, represented by `element` with a value of `textValue` .

### CSS classes

#### .combo_box

CSS class of the main combo box div.

#### .combo_box_list

CSS class of options list div.

#### .combo_box_value

CSS class of the currently selected option.

#### .combo_image

CSS class of the dropdown clicker image.

### Example

    var cb = new OAT.Combobox("[choose here]");
    document.body.appendChild( cb.div );
    cb.addOption(someElement, "option 1");
    cb.addOption(someOtherElement, "option 2");

Copyright (C) 2005-2008 OpenLink Software