Hi, we have a requirement to show an alert message when use enters the maximum length of the field that it is set to.
We have a multiple lines of text field and its limit we have currently set to is 5000 characters and when users reaches 5000 characters, I want to show an alert message. Please advise how can this be achieved.Thanks.
Hi James,
You could change the control of multiple lines of text field, such as change it to Rich Text Editor Control.
And if users reach 5000 characters, it will automatically alert this error message:
Hi,
Try below code
function AlertWhenLengthExceeded(executionContext)
{
Var formContext= executioncontext.getFormContext();
Var value = formContext.getAttribute("yourfieldschemanane").getValue();
if(value.length>500)
alert("your message");
}
Add this function on onchange of your field
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,524 Super User 2024 Season 2
Martin Dráb 228,469 Most Valuable Professional
nmaenpaa 101,148