inputEx - ColorField Usage

Basic ColorField creation

Use the following code to create a basic inputEx ColorField.

new YAHOO.inputEx.ColorField({parentEl: 'container1', label: 'Choose a color', description: 'Click to view the available colors'});

Updated event

How to listen to the updated event :

var el = YAHOO.util.Dom.get('container2'); var field = new YAHOO.inputEx.ColorField({parentEl: el }); var logDiv = inputEx.cn('div', null, null, "Log :<br />"); el.appendChild(logDiv); field.updatedEvt.subscribe(function() { logDiv.innerHTML += "Updated at "+(new Date())+"<br />"; });

Setting the color

The usual 'value' parameter:

new inputEx.ColorField({parentEl: 'container3', value: '#ADC2FF'});