onsubmit script error, not able to submit the client script

redth
Giga Expert

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);

}

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

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

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

6 REPLIES 6

Musab Rasheed
Tera Sage
Tera Sage

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

Please hit like and mark my response as correct if that helps
Regards,
Musab

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.

Go through this

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0683268

Mark my answer as correct if that helps

Regards

Please hit like and mark my response as correct if that helps
Regards,
Musab

Ankur Bawiskar
Tera Patron
Tera Patron

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

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader