• Shabista Zaidi
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hi All,

I have created the Single Page with Input text, Button & Output text field. The user enters some value in a text box after clicking on the button the output shows in below. But I am getting an error. Pls find the snippet code below
 
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
    
 <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
   	<div class="row">
        <h2 class="header">Basic Input Text</h2>
        <lightning:input aura:id="text" name="input1" label="Enter some text" />
        <!-- Brand variant: Identifies the primary action in a group of buttons -->
    <lightning:button variant="brand" label="Brand action" title="Brand action" onclick="{! c.handleClick }" />
    </div>
    You entered: <ui:outputText aura:id="ou"/>	
    
</aura:component>

JS Controller:
 
({
    doInit  : function(component, event, helper) {
    
    
    
},
	handleClick  : function(component, event, helper) {
        var ip = component.find("text");
        var op = ip.get("v.value");
        alert(op);
        var ot = component.find("ou");
        	ot.set("v.value",op);
		
    
	}
    
    
})

Error:


Error

Pls help me on this.

Adv Thanks,
VSK98
  • July 16, 2018
  • Like
  • 0