Glossary Item Box
ComboBox has next client side events:
| Client-side event | Description |
| onBeforeChange | Occurs when selected item is about to be changed. |
| onChange | Occurs when selected item is changed. |
| onItemsRequested | Occurs when items is already requested from server |
| onItemsRequesting | Occurs when items is needed to request from server |
Also ComboBox has some client-side API functions to easily manipulate with control and its value without postback.
Client-side API functions list:
| Function name | Description |
| al_ComboBox_SetEnable(clientID, isEnable) | Enables or disables the control with given identifier clientID, new state sets with isEnable value |
| al_ComboBox_IsEnabled(clientID) | Returns is the control enabled or not. |
| al_ComboBox_SetVisible(clientID, isVisible) | Shows or hides the control with identifier clientID, new state depends on isVisible value |
| al_ComboBox_IsVisible(clientID) | Returns is the control visible or not. |
| al_ComboBox_SetValue(clientID, value) | Sets the control's selected value. |
| al_ComboBox_GetValue(clientID) | Gets the control's value. If the item has not value the function return item's text. |
| al_ComboBox_SetText(clientID, value) | Sets the control's selected text. |
| al_ComboBox_GetText(clientID) | Gets the control's text. |
| al_ComboBox_SetSelectedIndex(clientID, itemIndex) | Sets the new control selected item index |
| al_ComboBox_GetSelectedIndex(clientID) | Gets the control selected item index |
Example:
<cc1:ComboBox ID="ComboBox1" runat="server"></cc1:ComboBox>
<input id="btn1" onclick="al_ComboBox_SetEnable('ComboBox1', false);" type="button" value="Disable ComboBox" />
<input id="btn2" onclick="al_ComboBox_SetEnable('ComboBox1', true);" type="button" value="Enable ComboBox" />
<input id="btn2" onclick="al_ComboBox_SetVisible('ComboBox1', true);" type="button" value="Show ComboBox" />
<input id="btn2" onclick="al_ComboBox_SetVisible('ComboBox1', false);" type="button" value="Hide ComboBox" />
<input id="btn2" onclick="al_ComboBox_SetValue('ComboBox1', '2');" type="button" value="Set ComboBox value to '2'" />
<input id="btn2" onclick="alert(al_ComboBox_GetValue('ComboBox1'));" type="button" value="Get ComboBox color" />
| See Also |
Controls: ComboBox