MComboBox

From HTML5 Builder
Jump to: navigation, search

The MComboBox component is a combobox, a field whose value user can choose from a list of possible values, defined by you.

Usage

Get the Selected Item

From PHP:

$items = $this->ComponentName->Items;
$selectedItemIndex = $this->ComponentName->ItemIndex;
$selectedItem = null;

// Search for a matching key. 
foreach($items as $item) {
    if ( $item["Key"] ==  $selectedItemIndex) {
        $selectedItem = $item;
        break;
    }
}

// Get the value.
$selectedItemValue = $selectedItem["Value"];

Client-side Features

DOM Elements

The component generates the following client-side DOM elements:

  • Wrapper (HTMLDivElement). Full web browser support. Access it with $("#ComponentName_outer").get()[0].
    • Main element (HTMLSelectElement). Full web browser support. Access it with: $("#ComponentName").get()[0].
      • Option group (optional) . Full web browser support. Access it with: $("#ComponentName optgroup").get()[OptionGroupIndex].
        • Option (HTMLOptionElement). Full web browser support. Access it with: $("#ComponentName option").get()[OptionIndex].

Client-side Events

Documented in the RPCL Reference.

Server-side Features

Properties, Methods and Events

Documented in the RPCL Reference.

See Also

  • Alternatives: ComboBox (web applications).