-
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

Should You Find a Salesforce Partner Checklist 2024
Salesforce Partners offer specialized services like consulting and customization for better customer relationships and efficient business processes. But is it always necessary to find a…

Best Practices in Testing | Salesforce Developer Guide
To be successful in the IT sector, you must be familiar with all of the finest testing procedures. It is critical to have testing best…

Introduction To Workbench In Salesforce
Workbench is a web tool used to interact with Salesforce organizations via API (Application programming interface). You can use Workbench to explore, inspect, edit, migrate…
Popular Salesforce Videos
Salesforce India Engineer Salary Revealed | Salary Break Up | Company Review
In this video, Soumyajit Bhattacharyay has given a detailed review of Salesforce. Talked about the tech stack that they work in. Talked about their offices…
Get a Complete View of Salesforce Data with MongoDB
Teri will show you how you can incorporate Salesforce (relational data) into a MongoDB collection (non-relational data) to give your customers a unified customer experience.…
TOP 20 Salesforce Integration Interview Questions and Answers 2019 | Salesforce Integration
In this video, Wisdom Jobs and Tutorials explains the 20 most popular questions asked during Salesforce Integration interviews. These questions cover topics like what web…