I have a lightning component which acts as a text area field. The mark up is as given below.
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes">
<aura:attribute name="Label" type="String" />
<aura:attribute name="fID" type="String" />
<div class="slds-form-element">
<label class="slds-form-element__label" for="{!v.itemID}">{!v.Label}</label>
<textarea id="{!v.fID}" class="slds-textarea" rows="3" />
</div>
</aura:component>
I am using this component in a parent form component. On click of a button from there I am fetching the values from inside all such child components which act as different field types using document.getElementById().value
. It works for all <input>
type tags but returns the value as undefined for the <textarea>
tag.
Any suggestions regarding tackling such a scenario?
Best Answer
The
value
property oftextarea
has just been whitelisted and should be available next week.