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
Srikanth TSrikanth T 

.get is not a function: When i am getting the value of the input to js controller i am facing the error.

Component: 

<aura:attribute name="negotiatePrice" type="Integer" />

<table class="slds-table slds-table--bordered slds-table--cell-buffer">
                  <tbody>
<aura:iteration items="{!v.userList}" var="con" aura:id="usrLst">
                                <tr>
                                    <th scope="row">
                                        <div class="slds-truncate" title="{!con.Name}">{!con.Name}</div>
                                    </th>
                                    <th scope="row">
                                        <div aura:id="usrLic" class="slds-truncate" title="{!con.TotalLicenses}">{!con.TotalLicenses}</div>
                                    </th>
                                    <th scope="row"> 
                                   <aura:iteration items="{!v.costList}" var="cst">                                     
                                   <aura:if isTrue="{!con.Name == cst.Name}">                                   
                                   <div class="slds-truncate" title="{!cst.License_Price_Per_Month__c}">{!cst.License_Price_Per_Month__c}</div>
                                   </aura:if>
                                   </aura:iteration>
                                        </th>
                                    
                                    <th scope="row" >
                                     <div class="slds-truncate">
                                    <input type="number" aura:id="myAtt" placeholder="Enter Negotiated Price" class="slds-input inputField"  value="{v.negotiatePrice}" onchange="{!c.CalculatePrice}" /> 
                               
                                    </div>
                                        </th>
                                   
                                    </tr>   
                                </aura:iteration>
 </tbody>
                    </table>

Controller:

CalculatePrice : function(component, event, helper) {  
        
        alert('Calculate');
          var nPrice = component.find("myAtt");
          var negotiatePrice = nPrice.get("v.value");
        
         alert('negotiatePrice'+negotiatePrice);
        
    },  
SwethaSwetha (Salesforce Developers) 
HI Srikanth,

As per https://salesforce.stackexchange.com/questions/281201/error-component-find-get-is-not-a-function-in-lightning there is a bug because of the way aura:if renders content.

Please check if the workaround suggested in the article is feasible for your scenario.

Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you
Srikanth TSrikanth T
Hi Swetha,

Thanks for the reply,
As per the above link, i am not using the input inside the aura:if, i am using that inside aura:iteration.

And i have tried this also, it's not working.
Footprints on the MoonFootprints on the Moon
Hi Srikanth,
I see you are missing exclamation sign before v.negotiatePrice in below tag-
<input type="number" aura:id="myAtt" placeholder="Enter Negotiated Price" class="slds-input inputField"  value="{v.negotiatePrice}" onchange="{!c.CalculatePrice}" />
Change it to below and try -
<input type="number" aura:id="myAtt" placeholder="Enter Negotiated Price" class="slds-input inputField"  value="{!v.negotiatePrice}" onchange="{!c.CalculatePrice}" />
If the issue persists, try changing <input> to <lightning:input> like below-
<lightning:input type="number" aura:id="myAtt" name="negoPrice" value="{! v.negotiatePrice}" placeholder="Enter Negotiated Price" onchange="{!c.CalculatePrice}" />
Let me know if this helps!