Glossary Item Box
ColorPicker has next client side events:
| Client-side event | Description |
| onBeforeChange | Occurs when the selected color is about to be changed. |
| onChange | Occurs when the selected color is changed. |
Also ColorPicker 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_ColorPicker_SetEnable(clientID, isEnable) | Enables or disables the control with given identifier clientID, new state sets with isEnable value |
| al_ColorPicker_IsEnabled(clientID) | Returns is the control enabled or not. |
| al_ColorPicker_SetVisible(clientID, isVisible) | Shows or hides the control with identifier clientID, new state depends on isVisible value |
| al_ColorPicker_IsVisible(clientID) | Returns is the control visible or not. |
| al_ColorPicker_SetValue(clientID, color) | Sets the control's color to color |
| al_ColorPicker_GetValue(clientID) | Gets the control's color value |
Example:
<cc1:ColorPicker ID="ColorPicker1" runat="server"></cc1:ColorPicker>
<input id="btn1" onclick="al_ColorPicker_SetEnable('ColorPicker1', false);" type="button" value="Disable ColorPicker" />
<input id="btn2" onclick="al_ColorPicker_SetEnable('ColorPicker1', true);" type="button" value="Enable ColorPicker" />
<input id="btn2" onclick="al_ColorPicker_SetVisible('ColorPicker1', true);" type="button" value="Show ColorPicker" />
<input id="btn2" onclick="al_ColorPicker_SetVisible('ColorPicker1', false);" type="button" value="Hide ColorPicker" />
<input id="btn2" onclick="al_ColorPicker_SetValue('ColorPicker1', '#ff0000');" type="button" value="Set ColorPicker value to 'red'" />
<input id="btn2" onclick="alert(al_ColorPicker_GetValue('ColorPicker1'));" type="button" value="Get ColorPicker color" />
| See Also |
Controls: ColorPicker