-
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
Everything You Need to Know about Salesforce Partner Portal
Implementing a robust partner portal becomes paramount as businesses strive to foster stronger partner relationships and expand their reach. Salesforce Partner Portal offers a powerful solution…
Sort Picklist Values in Lightning Component | Salesforce Tutorials
In this article, you will learn to sort the values in Picklist in Lightning Component. You just have to add an additional line to your…
Creating and Populating a Wrapper in Apex
As Apex is a statically typed language, you must choose only one object type per list to iterate. What if you want to iterate an…
Popular Salesforce Videos
Apex Design Patterns : The Singleton Pattern in Salesforce || #Salesforce #DesignPatterns
The Singleton Pattern One Private variable of the class itself will hold the instance of the complete class so that we can access all the…
Salesforce Vaccine Cloud
Salesforce is launching Vaccine Cloud, a set of tools to enable government and healthcare organizations to manage and deploy COVID-19 vaccination programs. Vaccine management has…
Who Should Use SFRA and PWA? | Salesforce Commerce Cloud
Different organizations need different architecture according to their needs. Organizations who want their website built on the latest technology and modern approaches can go towards…