Use the following code to create a basic inputEx Textarea.
1 | new inputEx.Textarea({parentEl: 'container1', value: 'Textarea can contain\nmultiline text !\n'}); |
view plain | print | ? |
Test of the setValue, getValue methods
1 | var div = YAHOO.util.Dom.get('container2'); |
2 | var textField = new inputEx.Textarea({parentEl: div, showMsg:true, required:true}); |
3 | |
4 | var button1 = inputEx.cn('button', null, null, "SetValue"); |
5 | div.appendChild(button1); |
6 | YAHOO.util.Event.addListener(button1, "click" ,function() { |
7 | textField.setValue('Textarea can contain\nmultiline text !\n'); |
8 | }); |
9 | |
10 | var button2 = inputEx.cn('button', null, null, "GetValue"); |
11 | div.appendChild(button2); |
12 | YAHOO.util.Event.addListener(button2, "click" ,function() { |
13 | alert(textField.getValue()); |
14 | }); |
view plain | print | ? |
Set the size using "rows" and "cols" attributes.
1 | new inputEx.Textarea({parentEl: 'container3', value: 'Set the size...\nusing "rows" and "cols" attributes !\n', rows: 8, cols: 40}); |
view plain | print | ? |
Set the min/max length, typeInvite...
1 | new inputEx.Textarea({parentEl: 'container4', showMsg:true, required:true, typeInvite:"Type text here", minLength:10, maxLength:20, name: "Test4"}); |
view plain | print | ? |