How to display multi line error message in the toastr ??
I have formatted my error message like below
"Please fix the following: \r\nFirst Name is required\r\nLast Name is required\r\nEmail Address is required\r\n"
But in the toasrt it shows in the single line. Please help
\n inside the string works!!!
Toast Notifications notify the user of a system occurrence. The notifications should have a consistent location in each application.
As told by Dr.Stitch , toastr using the string as html so we have to add for the new line :
Please fix the following: </br>First Name is required</br>Last Name is required</br>Email Address is required</br>
- An update: 15/12/2020:
For the version 12+ :
toastr.success('Please fix the following: </br>First Name is required</br>Last Name is required</br>Email Address is required</br>', '', { closeButton: true, timeOut: 4000, progressBar: true, allowHtml: true });
This will work !!! thank you for the help.
allowHtml: true
toastr.success('\'Second Review\' validation has started. </br>All SME\'s and Reviewers will get an email notification', '', { closeButton: true, timeOut: 4000, progressBar: true, allowHtml: true });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With