# inputEx - Textarea Usage

## Basic Textarea creation

Use the following code to create a basic inputEx Textarea.

new inputEx.Textarea({parentEl: 'container1', value: 'Textarea can contain\nmultiline text !\n'});

## Textarea setValue/getValue

Test of the setValue, getValue methods

var div = YAHOO.util.Dom.get('container2'); var textField = new inputEx.Textarea({parentEl: div, showMsg:true, required:true}); var button1 = inputEx.cn('button', null, null, "SetValue"); div.appendChild(button1); YAHOO.util.Event.addListener(button1, "click" ,function() { textField.setValue('Textarea can contain\nmultiline text !\n'); }); var button2 = inputEx.cn('button', null, null, "GetValue"); div.appendChild(button2); YAHOO.util.Event.addListener(button2, "click" ,function() { alert(textField.getValue()); });

## Change Textarea size

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

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

## More options

Set the min/max length, typeInvite...

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