Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2022 12:49 PM
Thanks Cris! I am trying to use this in the onChange script that I created to compare the short description and description. I am getting a javascript error on the portal record producer though.
Here is the onChange client script. Also, how to I add an alert popup if the description is under 251 characters?
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
//Verify that Short Description and Description are not the same
var title = g_form.getValue('short_description');
if(title == newValue)
{
alert('Description cannot be the same as the short description. Please enter additional information.');
g_form.clearValue('description');
}
//Verify that Description is at least 250 characters
var ga = new GlideAjax('CPcheckDescriptionLength'); //The name of the Script Include
ga.addParam('sysparm_name', 'isLengthSatisified'); //The name of the method we want to use in the SI
ga.addParam('sysparm_sd', g_form.getValue('description')); //Pass your description to the param we define in the SI
ga.getXMLAnswer(function(response){ //Callback function to use the 'response' from our SI
jslog(response); //Will be true or false
});
}