-
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
10 Key Benefits of Salesforce Field Service for Your Company
For many companies, the border between an excellent or poor customer experience is based on the quality of the field services they offer. Satisfied consumers…
Steps to Install the Salesforce Force.com IDE Plug-In in Eclipse
Force.com IDE can be installed into your existing Eclipse distribution. Following are the prerequisite to install Force.com IDE on your workstation : Don’t forget to check…
Why and How’s of Salesforce Training
Imagine you buying a CRM for your sales team after taking time to evaluate, test, and negotiate with the vendor and not use it eventually.…
Popular Salesforce Videos
What is Headless Commerce? | Salesforce Commerce Cloud
Brands need to keep up with this change and require a certain level of agility and nimbleness. This is where Headless Commerce is a game…
Configuration Attribute In Salesforce CPQ | Salesforce Development Tutorial | Learn Salesforce Series by Algoworks
Configuration attributes can be used in setting up the value of multiple shared product option fields simultaneously in Salesforce CPQ. In this Salesforce tutorial, you…
Salesforce Service Cloud Overview Demo
Service Cloud is a complete service solution built on the Salesforce platform that lets you quickly adapt to change, to deliver trusted service from anywhere.…