
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2017 09:51 AM
Update 8/7:
I had to re-do the script because i was running into issues with the split. When someone used ':' to end their intro to the issue, it would not let them submit. It was also messing with older stories. So this is what I have now but I cannot understand why this will not let me submit at all now. Even when all of the fields are filled in.
function onSubmit () {
var req_keys = [
'Instance(s):',
'Record(s) used:',
'Impacted user group(s):',
'Logged in user to view/create issue:',
'Steps to reproduce:'
];
var array = [];
var desc = g_form.getValue('description');
for (var i = 0; i < req_keys.length; i++); {
if (desc.indexOf(array, req_keys[i]) > -1) {
alert('Please include all template fields in your description:\n\nInstance(s) ->\nRecord(s) used ->\nImpacted user group(s) ->\nLogged in user to view/create issue ->\nSteps to reproduce ->');
return false;
}
}
}
____________________________________________________________________________________________________________________________________________________
Hi,
I need to check to see if the "description" field has been changed when a user logs and incident. I have 4 fields within the description field that are mandatory to complete before the record can be submitted. I am running into issues trying to figure out how to check if the description field has been filled out completely. I have tried to compare the empty value to the filled value but then i cant submit the form. Any help would be appreciated!
See screen shots below:
Here is the client script I currently have:
function onSubmit() {
var description = g_form.getValue('u_description');
g_form.getValue('u_description');
//Type appropriate comment here, and begin script below
if ( description == 'Instance: +
'\n' + 'Record used:'
'\n' + 'Impacted user group:'
'\n' + 'Steps to reproduce:'); {
alert('Please fill out all description requirements and attach screenshots');
return false;
}
}
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2017 10:34 AM
Please check if this helps.
function onSubmit() {
var i;
var description = g_form.getValue('u_description');
var dec_text = description.split('\n');
for(i = 0; i < dec_text.length; i++){
var description_text = dec_text[i].split(':');
if(description_text[1] == ""){
alert('Please fill out all description requirements and attach screenshots');
return false;
}
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2017 06:02 AM
That works! Thank you for your help Shishir!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-03-2017 08:07 AM
So now I have a new issue related to the original topic.
When users try to enter in the required information - they can only do it on one line (ie. they cant use a new line). How can I fix this issue?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-03-2017 09:24 AM