limit characters of multiline text
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2024 03:56 AM
Hi Team,
can anyone please help me.Below script is working in native UI. When user typing itself, it will stop if user entered more than the characters mentioned in script.i required the same way work in portal.
function onLoad() {
var control = g_form.getControl('comments');
//Set its onkeyup method
control.onkeyup = isMaxLength;
}
function isMaxLength() {
var mLength = 170;
var control = g_form.getControl('comments');
if (control.value.length > mLength) {
g_form.hideErrorBox('comments');
g_form.showErrorBox('comments', 'You have reached the maximum character limit for this field.');
control.value = control.value.substring(0, mLength);
} else {
g_form.hideErrorBox('comments');
}
}
6 REPLIES 6
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2024 04:56 AM
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2024 05:17 AM
Hi Harish,
Above links are checking max length only. That will not work for multiline text