-
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
Learn About the Governor Limits in Salesforce
Governor Limits are a set of rules and restrictions in Salesforce that limit the monopolistic use of cloud resources by one or more organizations that…
Custom Metadata Types: Your Recipe for API Key Security
Imagine we are running a top-secret sandwich joint, and we've got the most delicious secret sauce recipe that's known to humankind. Now, we don’t want…
Top 4 Considerations in Choosing your Salesforce CPQ Partner
Congratulations, you’ve made the decision to implement Salesforce CPQ! Now comes the challenging task of choosing the right Salesforce CPQ partner to help fulfill your…
Popular Salesforce Videos
Soar: A Salesforce Philanthropy Film
When one of us is lifted up, all of us are lifted up. ? That's why we're supporting #GoGiveOne, a campaign to advance global vaccine…
Simplify Case Management in Salesforce With Email-to-Case Advance
While Email-to-Case is one of the most widely used features in Salesforce Service Cloud, its limited functionalities may hold you back. At Grazitti, the Salesforce…
Salesforce Health Cloud – Creating Patient Relationships Not Records
Unfortunately, the gruesome truth facing the world today is the ever increasing pressure of diseases due to chronic disorders, pollution, growing age, and definitely increasing…