-
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
Salesforce Org Migration to Hyperforce
What is Org Migration? In order to arrange for our customers' continuing growth, we have a tendency to sometimes ought to perform associate degree activity…
The Agentforce Dashboard: Tracking AI-Generated Pipeline vs. Human Outreach
Modern corporate revenue operations require clear data to separate the impact of automated processes from human activities. Enterprise sales systems now use advanced AI agents…
The Critical Role of Salesforce Partners in Building a 360-Degree Customer View
Modern customers demand tailored interactions, quality service, and quick responses to their queries. With organizations grappling with dynamic customer expectations, the concept of a 360-degree…
Popular Salesforce Videos
How to Get a Job in Salesforce as a Fresher | Video Guide
Looking to start a career in Salesforce. Wondering how to get a job in Salesforce as a fresher. Check out this video it will guide…
Data Archiving in Salesforce | Backup and Restore
Learn the techniques, patterns and strategies when it comes to handling data archiving, backup and restores. Watch this video and learn all about Data Archiving…
5 Steps to Faster Case Resolution | Salesforce Support
When it comes to filling out a Salesforce case from, the description field and attached files are key to fast routing and resolution. Here are…