You need to sign in to do that
Don't have an account?
Shivendra Singh Pawar
How to Show a message on form submit in lightning
Dear Team,
Greetings !!!
We have created lightning: button in .cmp file. On .js file, we have written code for insert, after data saved all textboxes getting blank. Now we have to display the success message box. Plz, let us know how to display a message box. Code is as follows :
Greetings !!!
We have created lightning: button in .cmp file. On .js file, we have written code for insert, after data saved all textboxes getting blank. Now we have to display the success message box. Plz, let us know how to display a message box. Code is as follows :
save: function(component, event) { var getCon = component.get("v.NewCon"); var action = component.get("c.CreateNewContact"); action.setParams({ con: getCon }); action.setCallback(this, function(a) { var state = a.getState(); if (state === "SUCCESS") { var name = a.getReturnValue(); component.set("v.NewCon.FirstName", ""); component.set("v.NewCon.LastName", ""); component.set("v.NewCon.Email", ""); component.set("v.NewCon.Phone", ""); component.set("v.NewCon.Description", ""); } });
https://developer.salesforce.com/docs/component-library/bundle/force:showToast/documentation
Greetings to you!
Use the below links. It must provide solution of your problem
To display alert message on click of button-
https://salesforce.stackexchange.com/questions/152837/lightning-component-to-display-alert-message-on-click-of-button
To show toast in lightning record page by using force:showToast. Toast are the message box or you can say notification which developer can show according to action
of the user.
https://webkul.com/blog/forceshowtoast-in-lightning/
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Deepali Kulshrestha
www.kdeepali.com