-
Confirm box on submit for Salesforce Lightning Button does not appear
Confirm box on submit for Salesforce lightning button does not appear:
I am going through "Build a Lightning App with the Lightning Design System" project in Trailhead.
In the AccountList.cmp component there is below code that creates "Delete" button in each row in the table created in that project.
As exercise states - click on any Delete botton should dsplay dialog box. It does Not happen.
So far I was not able to find out why, please help. Many thanks
<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>------------------ in the javascript controller AccountListControlle.js there is following code:
deleteAccount: function(component, event, helper) {// Prevent the form from getting submitted
event.preventDefault();// Get the value from the field that's in the form
var accountName = event.target.getElementsByClassName('account-name')[0].value;
confirm('Delete the ' + accountName + ' account? (don’t worry, this won’t actually work!)'); --- THIS LINE DOES NOT WORK, DIALOG BOX DOES NOT SHOW UP.
}
Log In to reply.
Popular Salesforce Blogs
RemedyForce Can be Your ITSM Solution: Here’s How | Salesforce Guide
IT is changing the scene in all major professional fields, and its partnership with business management is helping enterprises in scaling and managing businesses, IT…
Comparison Between Salesforce B2B and B2C Commerce Cloud Solutions
The proliferation of the internet and smart devices has forced us to enter the digital-first economy, where online trade has become the lifeline for most…
10 Must-Know Facts About Salesforce Managed Services
What are Salesforce Managed Services? Salesforce Managed Services involve various tasks, starting with the initial setup and ongoing monitoring of a company’s Salesforce solutions to…
Popular Salesforce Videos
Salesforce Live Executive Experience: UK and Ireland 2021
At Salesforce Live Executive Experience we welcomed guests in-person and virtually to enjoy enlightening content, much missed networking and a performance from Jools Holland. The…
Features of Salesforce Industries (Vlocity)
There are many features of Salesforce Industries that make it a one-stop solution for businesses. Salesforce Industries or Vlocity offers Omnichannel processes with lightning Web,…
Introduction to Salesforce Apex for Developers
Have you ever wanted to write a Trigger in Salesforce? This workshop is designed for people who would like to begin learning the basics of…