inputEx - RTEField Usage

Basic RTEField creation

Use the following code to create a basic inputEx RTEField.

new YAHOO.inputEx.RTEField({parentEl: 'container1', name: 'rteField',value:"I'm the <i>default</i> value.<br />I've been set through the <b>value</b> option."});

RTEField setValue/getValue

Test for setValue/getValue using the RTEField.

var div = YAHOO.util.Dom.get('container2'); var htmlField = new YAHOO.inputEx.RTEField({parentEl: div, name: 'test2'}); var button1 = YAHOO.inputEx.cn('button', null, null, "SetValue"); div.appendChild(button1); YAHOO.util.Event.addListener(button1, "click" ,function() { htmlField.setValue('RTEField can contain<br ><b>HTML</b> !'); }); var button2 = YAHOO.inputEx.cn('button', null, null, "GetValue"); div.appendChild(button2); YAHOO.util.Event.addListener(button2, "click" ,function() { alert(htmlField.getValue()); });

Using the SimpleEditor

Use the following code to create a SimpleEditor widget

var field3 = new YAHOO.inputEx.RTEField({parentEl: 'container3', name: 'rteField3', type: 'simple'}); field3.setValue("<i>Value set just after init...</i>");