-
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
All You Need to Know About Salesforce Net Zero Marketplace
You may have heard of the Salesforce Net Zero Marketplace and be wondering how it fits into the Salesforce world and Net Zero Cloud. Here…
All You Need to Know About Queues in Salesforce
Case queues in Salesforce give your bolster organization a simple, adaptable arrangement to support and disseminate the cases over different levels of the organization. You'll…
How to Manage Salesforce Integrations with Event Monitoring?
Salesforce offers several features and tools designed to improve business processes. One of the main aspects of leveraging Salesforce is integrating with other systems to…
Popular Salesforce Videos
How to Become a Salesforce Consultant at Any Age
Companies are in great demand of skilled Salesforce consultants as a means to achieve their Salesforce objectives for better output in their business. With the…
Basics of Salesforce Flow in 15 minutes
In this video, Jitendra Zaa gives a detailed overview of the basics of Salesforce Flow in just 15 minutes. He covers everything from how to…
How to Get Jobs or Work Outside India? | Salesforce Developer vs Cloud Professional
In this Video Shrey covered answers to the three questions which are: 1. How do you find a job in Salesforce as a fresher or…