We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

JavaScript error in your browser console in portal

Niyeeti Dey
Tera Contributor

Hi Everyone,

 

I am getting error in portal  JavaScript error in your browser console while its working fine in native view

 

Client Script:onSubmit

 

function onSubmit() {

if (g_form.getValue('u_report_obtained') == 0 && g_form.getValue('u_q1') == 'yes') //report obtained= false and and q1 is yes {

var attachments = document.getElementById('header_attachment_list_label'); if (attachments.style.visibility == 'hidden' || attachments.style.display == 'none') {

g_form.addErrorMessage("Please attach the latest third-party audit report and respond to the attestation questions below.");

} else { return false; } } }

6 REPLIES 6

Niyeeti Dey
Tera Contributor

Hi @Ankur Bawiskar  sir Thank you but its not a catalog item, its a form in GRC. The script is not working for my requirement.

@Niyeeti Dey 

then you can use before update/insert BR and stop form submission.

OR

you can use onSubmit + GlideAjax

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