- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-08-2016 02:25 PM
We thought it would be a good idea to make close notes mandatory when the ITIL user marks and incident as resolved.
Unfortunately this has resulted in them just typing stuff like "Fixed" or "Done" or "Complete" in the field.
Is there a way to make a minimum length attribute on the field so that the workers are forced to write more descriptive answers?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-08-2016 02:53 PM
Wrtie onChange script.
var myFieldValue = g_form.getValue('Field_name');
if (myFieldValue.toString().length < 6) { // or whatever number you want
g_form.setValue('field_name','');
alert('Please enter 6 or more characters.');
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-08-2016 02:53 PM
Wrtie onChange script.
var myFieldValue = g_form.getValue('Field_name');
if (myFieldValue.toString().length < 6) { // or whatever number you want
g_form.setValue('field_name','');
alert('Please enter 6 or more characters.');
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-08-2016 05:23 PM
Thank you, that's definitely on the right track. Before I go and start testing, do you mind explaining what the line "g_form.setValue();" does?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-08-2016 10:04 PM
That sets the value to the field. In the above code by Deep it's actually clearing the field value to null.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-27-2024 10:39 PM
this script is running for every character I enter in work notes. But my requirement is to validate the length of work notes should not be less than 25 chars