- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-30-2022 07:34 AM
Hi, I'm receiving the below error when I try to submit the client script. Please assist. See this error on all the types of client script.
onSubmit script error: ReferenceError: validateFunctionDeclaration is not defined:
function onSubmit(){
var functionName = g_form.getValue("type");
if(functionName == "")
return true;
return validateFunctionDeclaration("script". functionName);
}
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2022 03:00 AM
Hi,
seems you are trying to call that function but it's not defined anywhere?
Are you having any UI script which holds this function -> validateFunctionDeclaration
Did you search that?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-30-2022 07:42 AM
Hello,
Why are you returning twice and why are you using validateFunctionDeclaration function ? and also if you want to restrict form to get submitted you have to use return false
Regards
Regards,
Musab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-30-2022 07:58 AM
Hi, The script i have pasted above is the error I'm receiving irrespective of onchange, onload and onsubmit client scripts. That is not the code I'm using.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2022 02:48 AM
Go through this
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0683268
Mark my answer as correct if that helps
Regards
Regards,
Musab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2022 03:00 AM
Hi,
seems you are trying to call that function but it's not defined anywhere?
Are you having any UI script which holds this function -> validateFunctionDeclaration
Did you search that?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader