-
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
Why Flow with Salesforce Flow?
Earlier when you required a custom feature in your Salesforce installation to support your business process, the only available options were to create a brand…
Top 4 Reasons Why Community-Salesforce Integration is Instrumental to Your Business
Waiting for a customer support agent to resolve your query? We guess, not! Customers today value their time and expect instant support. So, brands today…
Salesforce and Gmail Integration | The Perfect Integration Guide
Salesforce Gmail Integration Gmail is a free Web-based Mail service that provides users with gigabytes of storage for emails and information and provides the ability…
Popular Salesforce Videos
Salesforce Lightning Tutorial | Salesforce Training | Lightning Training Video
This Salesforce Lightning Tutorial will explain the concept of lightning components along with the lightning component capabilities. Lightning includes the Lightning Component Framework and some…
How to use Einstein Engagement Scoring in Salesforce Marketing Cloud
Cameron Robert shows how to gain actionable insights from the Einstein Engagement Scoring Dashboard in Salesforce Marketing Cloud, and talks through a few activity ideas…
Duplicate Management In Salesforce | Duplicate Rule and Matching Rule
Learn how to work with duplicate rules and duplicate records in Salesforce. This video will cover the following points - 1. Matching Rule (1:20) Get…