-
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
8 Foolproof Steps to Salesforce Classic to Lightning Migration
Migrating any critical software requires addressing the related complex challenges and preparing a clear roadmap for implementation. As the work environment and resources of every…
Showcasing the Salesforce Ecosystem
Managing the Company Information with Salesforce Provides the Ultimate Support. Salesforce provides the website visitors, clients, managers, and service agents the required platform that acts…
4 Types of Salesforce Community Licenses
The foremost challenge that organizations face today is to provide excellent customer service to their customers and partners and include it in their daily processes.…
Popular Salesforce Videos
Salesforce Anywhere – Release Readiness LIVE, Spring '21
Salesforce, the global leader in CRM, introduced Salesforce Anywhere – bringing together powerful new technologies and platform services to help organizations unlock new levels of…
Understanding Service Cloud & Case Management in Salesforce
In this video, Shrey is not only teaching but also demonstrating the Basics of Salesforce Service Cloud and Case Management. You will be learning: 1.…