-
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
How Salesforce Account Engagement Drives Better Marketing Results
Effective marketing relies on more than just creative campaigns—it requires intelligent tools that connect with prospects, track engagement, and optimize results. Salesforce Account Engagement provides…
Reinforcing Fintech Companies, Salesforce Extends Einstein Analytics For Financial Services Cloud!
There has been a rapid change in the banking and wealth management industry, lately. Several modern fintech competitors have stepped in to simplify the ways…
Building Dynamic User Experiences with Salesforce Lightning Beyond Static Screens
Gone are the days of one-size-fits-all Salesforce interfaces. Today's users demand personalized, dynamic experiences that cater to their unique roles, needs, and preferences. Salesforce Lightning…
Popular Salesforce Videos
Salesforce Summer '18 Release
I can’t believe Summer ’18 is already here in no time. I don’t know about all of you, but I still have my winter stuff…
When to use which Sandbox? Salesforce Interview Questions and Answers
Watch this video by CRS Info Solutions to when to use which Sandbox. Salesforce sandboxes are copies of your Production environment. A Sandbox contains all the…
Slack API Integration for Salesforce Marketing Cloud
Connect Salesforce Marketing Cloud and Slack the way you want. Watch this video to learn all about Slack API Integration for Salesforce Marketing Cloud. If…