• Yogesh Singh 03
  • NEWBIE
  • 0 Points
  • Member since 2016
  • Salesforce Developer


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
While going through one of the lightning tutorial on trailhead [trailhead topic you can find here "https://trailhead.salesforce.com/projects/slds-lightning-components-workshop/steps/slds-lc-4" ] I feal some code is missing in the code provided here.

In this para "Create the AccountList Component" part of code provided is.

<form class="account-form" onsubmit="{!c.deleteAccount}"> <input type="hidden" value="{!account.Name}" class="account-name" /> <!-- Use a Lightning Base Component To display an icon next to the label --> <lightning:button label="Delete" iconName="utility:delete" iconPosition="left" variant="destructive" /> </form>

on click of the lightning button the form should submit, and deleteAccount event should fire but its not happing. So I added "type='Submit'" property in the lightning button and then it worked. Lightning button now looks like.
<lightning:button type='Submit' label="Delete" iconName="utility:delete" iconPosition="left" variant="destructive" />.

I know this is how it works in Javascript but i am not sure about lightning. Please let me know is this the right way or am I missing something.

Thanks


 
While going through one of the lightning tutorial on trailhead [trailhead topic you can find here "https://trailhead.salesforce.com/projects/slds-lightning-components-workshop/steps/slds-lc-4" ] I feal some code is missing in the code provided here.

In this para "Create the AccountList Component" part of code provided is.

<form class="account-form" onsubmit="{!c.deleteAccount}"> <input type="hidden" value="{!account.Name}" class="account-name" /> <!-- Use a Lightning Base Component To display an icon next to the label --> <lightning:button label="Delete" iconName="utility:delete" iconPosition="left" variant="destructive" /> </form>

on click of the lightning button the form should submit, and deleteAccount event should fire but its not happing. So I added "type='Submit'" property in the lightning button and then it worked. Lightning button now looks like.
<lightning:button type='Submit' label="Delete" iconName="utility:delete" iconPosition="left" variant="destructive" />.

I know this is how it works in Javascript but i am not sure about lightning. Please let me know is this the right way or am I missing something.

Thanks