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

How to hide submit button in Service Portal

NewBee
Kilo Contributor

Can someone help on how to hide submit button in Service Portal ?

23 REPLIES 23

find_real_file.png

 

This is false

Hi,

please share complete script and where it is failing

Regards
Ankur

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

Hi,

the script worked well for me in native + portal for record producer

Do you require for record producer or catalog item?

Native:

find_real_file.png

Portal:

find_real_file.png

Regards
Ankur

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

Hi Ankur, here is the snapshot Error while running appears in console.log 

find_real_file.png

NewBee
Kilo Contributor

I have added this code in onload of client script

 

function onLoad() {

if(window == null){
// for portal
var z = this.document.getElementsByClassName("btn btn-primary btn-block ng-binding ng-scope");
z[0].style.display = 'none';
}else{
// for native
document.getElementById("submit_button").style.display = 'none';
}
}