-
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
Visualforce in Lightning Experience | Salesforce Guide
Although Lightning Experience introduces a whole new user interface to your Salesforce organisation, your Visualforce apps will continue to function. Many Visualforce pages operate in…
Getting Started with Salesforce Lightning Scheduler
If scheduling appointments is a consistent problem in your business, or you need to upscale your current system, try the Salesforce Lightning Scheduler. This add-on…
Upload Files as Attachment using Apex Salesforce
Files replaced Attachments in Salesforce. Now any type of document upload becomes part of Files/Content in Salesforce. With all the other advantages over Attachments, the…
Popular Salesforce Videos
Salesforce for Non Technicals | Salesforce for Non IT | Salesforce For Non Programmers
Wondering if Non-IT persons can learn Salesforce? Yes, watch this video and learn all you need to know. Do let us know in the comment…
Multi-factor Authentication in Salesforce | Setup of MFA
Multi-factor Authentication in Salesforce: Salesforce offers simple, innovative MFA solutions that provide a balance between strong security and user convenience. Because your business requirements and…
Tips for Importing Data in Salesforce
Data can be easily imported into Salesforce through various tools provided by Salesforce. Supported data sources include any program that can save data in the…