inputEx - Textarea Usage

Basic Textarea creation

Use the following code to create a basic inputEx Textarea.

1new inputEx.Textarea({parentEl: 'container1', value: 'Textarea can contain\nmultiline text !\n'}); 
view plain | print | ?

Textarea setValue/getValue

Test of the setValue, getValue methods

1var div = YAHOO.util.Dom.get('container2'); 
2var textField = new inputEx.Textarea({parentEl: div, showMsg:true, required:true}); 
3 
4var button1 = inputEx.cn('button'nullnull"SetValue"); 
5div.appendChild(button1); 
6YAHOO.util.Event.addListener(button1, "click" ,function() {  
7    textField.setValue('Textarea can contain\nmultiline text !\n');  
8}); 
9 
10var button2 = inputEx.cn('button'nullnull"GetValue"); 
11div.appendChild(button2); 
12YAHOO.util.Event.addListener(button2, "click" ,function() {  
13    alert(textField.getValue()); 
14}); 
view plain | print | ?

Change Textarea size

Set the size using "rows" and "cols" attributes.

1new inputEx.Textarea({parentEl: 'container3', value: 'Set the size...\nusing "rows" and "cols" attributes !\n', rows: 8, cols: 40}); 
view plain | print | ?

More options

Set the min/max length, typeInvite...

1new inputEx.Textarea({parentEl: 'container4', showMsg:true, required:true, typeInvite:"Type text here", minLength:10, maxLength:20, name: "Test4"}); 
view plain | print | ?