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
Sean BarkerSean Barker 

Connect Components with Events

Hi there,

I've been trying to complete the above trailhead module, but have hit a brick wall with the following error. 

Challenge Not yet complete... here's what's wrong:
The campingList component doesn't appear to have a Name input field in the form using a Lightning Base component.

Am I creating this error by including the AuraID on the lightning:input field? 

Am I going mad?  the campingList contains the campingform component and there is the following on there; 

<lightning:input aura:id="Name" name="Name" label="Name" value="{!v.item.Name}" />

Apart from not passing the trailhead, the form is functional.

 
Sean BarkerSean Barker
So after a little perservance, I went back to one of the earlier lessons.  I had to give all the elements the same aura id (itemform), then in the validateItemForm function I had to rewrite the validation to the following;

var validItem = component.find('itemForm').reduce(function (validSoFar, inputCmp) {
// Displays error messages for invalid fields
inputCmp.showHelpMessageIfInvalid();
return validSoFar && inputCmp.get('v.validity').valid;
}, true);
return(validItem);
Sean BarkerSean Barker
And itemname was changed to ;
<lightning:input aura:id="itemForm" name="Name" label="Name" value="{!v.newItem.Name}" required="true" />
Kevin Zuiker 10Kevin Zuiker 10
So, I know you solved your own issue, but I ran into this same issue and it was due to a different problem, so I figure I'll post.

I was missing the exclamation point after the left curly brace { in the value tag:

Incorrect:
<lightning:input aura:id="itemForm" name="Name" label="Name" value="{v.newItem.Name}" required="true" />
Correct:
<lightning:input aura:id="itemForm" name="Name" label="Name" value="{!v.newItem.Name}" required="true" />


Once I fixed that, I receive a similar error for the Packed input and it was because I used the word value instead of checked. See below.

Incorrect:
<lightning:input type="checkbox"
                         name="Packed"
                         label="Item Packed?"
                         value="{!v.newItem.Packed__c}"
                         aura:id="itemForm"/>
Correct:
<lightning:input type="checkbox"
                         name="Packed"
                         label="Item Packed?"
                         checked="{!v.newItem.Packed__c}"
                         aura:id="itemForm"/>
Jaap ScheperJaap Scheper
I named the item in my component just 'item', and I was not allowed to do so in this Challenge (but the form was still working)
After calling it 'newItem' the error disappeared. Sean did the same, but didnt mention this naming explicitly and I overlooked it at first sight.

Failing markup:
<lightning:input aura:id="campingitemform" 
				 name="itemname" 
				 label="Item name:" 
				 value="{!v.item.Name}" 
				 required="true" />
Working markup:
<lightning:input aura:id="campingitemform" 
				 name="itemname" 
				 label="Item name:" 
				 value="{!v.newItem.Name}" 
				 required="true" />