-
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
Enhance Your Cloud Security With Salesforce Shield
Ever since Cloud came into play, Data security is the buzzword that reverberates all over the corporate world. It has been proven time and again that…
Understanding sObjects in Salesforce: A Comprehensive Guide
Introduction In the realm of Salesforce, sObjects play a crucial role in managing and manipulating data. Short for "Salesforce Objects," sObjects are the fundamental data…
Salesforce Classic to Lightning Migration: Major Challenges and Solutions
Salesforce Classic used to be the primary interface for Salesforce users until 2016. But, when compared to other CRM contenders, Salesforce Classic started to be…
Popular Salesforce Videos
Benefits of Implementing Salesforce Revenue Cloud
Healthy revenue growth is a vital indicator of a firm’s success. The key aspects that majorly affect an organization’s revenue growth are sales, operations, finance,…
How to Learn Salesforce in easy step by step and get certified
From Salesforce instructor, Become a Salesforce Expert. Learn Salesforce step by step and get certified easily.
Salesforce Field Service Basics | Salesforce Webinar
Salesforce Field Service is a cloud-based platform that enables businesses to manage and automate their customer service operations. From customer contact management, and call routing…