function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Daniel Rudman 5Daniel Rudman 5 

Text area component

Hi,
Is there a text area UI component available or any way to achieve it without using a raw textarea element?

Thanks
NekosanNekosan
If you need to add text area in VF page, you can use 
http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_inputTextarea.htm
Daniel Rudman 5Daniel Rudman 5
I am lookin for a lightning component, not a VF page. Do you know how to acheive that in Lightning?
EnreecoEnreeco
Hi Daniel, try this:
App / Component:
<aura:application>
    <!-- global attribute that will store the value of the textarea-->
    <aura:attribute name="textareaValue" type="String" default="" />
    <textarea onchange="{!c.changeField}"></textarea>
    <br/>
    This is the output: [{!v.textareaValue}]
</aura:application>

Controller:
({
     changeField : function(component, evt, helper){
         //gets the html element from the change event
          var textarea = evt.srcElement;
          //sets a "textareaValue" attribute of the general component
          $A.run(function(){
              component.set('v.textareaValue',textarea.value);
          });
     }
})

This should work (not tested...some typos may be present :) )

--
May the Force.com be with you!
Michael PlunkettMichael Plunkett
Enreeco's solution worked for me.