Use the following code to create a basic inputEx RTEField.
1 | new inputEx.RTEField({parentEl: 'container1', name: 'rteField',value:"I'm the default value. I've been set through the value option."}); |
view plain | print | ? |
Test for setValue/getValue using the RTEField.
1 | var div = YAHOO.util.Dom.get('container2'); |
2 | var htmlField = new inputEx.RTEField({parentEl: div, name: 'test2'}); |
3 | |
4 | var button1 = inputEx.cn('button', null, null, "SetValue"); |
5 | div.appendChild(button1); |
6 | YAHOO.util.Event.addListener(button1, "click" ,function() { |
7 | htmlField.setValue('RTEField can contain HTML !'); |
8 | }); |
9 | var button2 = inputEx.cn('button', null, null, "GetValue"); |
10 | div.appendChild(button2); |
11 | YAHOO.util.Event.addListener(button2, "click" ,function() { |
12 | alert(htmlField.getValue()); |
13 | }); |
view plain | print | ? |
Use the following code to create a SimpleEditor widget
1 | var field3 = new inputEx.RTEField({parentEl: 'container3', name: 'rteField3', editorType: 'simple'}); |
2 | field3.setValue("Value set just after init..."); |
view plain | print | ? |