-
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
Streamlining Operations of a Leading Bike Aggregator Through Salesforce® Field Service Lightning
Client Profile The client is a leading Bike Aggregator in the US, a start-up that has recently raised multi-million-dollar investment. They have a public-private partnership…
Salesforce for Manufacturing to Optimize Productivity
The manufacturing sector has witnessed a complete, factory-wide digital makeover. The industries have leveraged technologies like artificial intelligence (AI), robotics, and blockchain. Salesforce for manufacturing…
Jira - Salesforce Integration: Why You Should Use a No-code Integration Platform?
Workflow automation, enhanced performance, and high availability are three of the most vital components of every successful modern-day enterprise. The ability to track valuable performance…
Popular Salesforce Videos
Create Custom App in Salesforce | Salesforce Custom App | Salesforce Tutorial
Watch this amazing video to learn how to create a custom app in Salesforce. Salesforce is a cloud-based platform that has transformed how companies have…
What is the Difference Between Profile Vs Permission Set?
What is the difference between Profile Vs Permission Set? The profile is mandatory for the users in Salesforce. A permission set is one thing that…
3 Easy to Use Salesforce Field Service Dashboards | AblyPro- Live Webinar
Watch AblyPro's exciting webinar video on Salesforce Field Service Reports & Dashboards. Discover how these powerful tools can drive efficiency and cut support costs for…