inputEx - Textarea Usage

Basic Textarea creation

Use the following code to create a basic inputEx Textarea.

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

Textarea setValue/getValue

Test of the setValue, getValue methods

			var div = Y.one('#container2');
			var textField = new Y.inputEx.Textarea({parentEl: div, showMsg:true, required:true});

			var button1 = inputEx.cn('button', null, null, "SetValue");
			div.appendChild(button1);
			Y.on("click" ,function() { 
				textField.setValue('Textarea can contain\nmultiline text !\n'); 
			},button1);

			var button2 = inputEx.cn('button', null, null, "GetValue");
			div.appendChild(button2);
			Y.on("click" ,function() { 
				alert(textField.getValue());
			},button2);
		

Change Textarea size

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

			new Y.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 Y.inputEx.Textarea({parentEl: 'container4', showMsg:true, required:true, typeInvite:"Type text here", minLength:10, maxLength:20, name: "Test4"});