How to hide Save and submit button in form

String
Kilo Sage

Hi Team ,

We create a custom form and need to hide the save and submit button ,Please guide 

below is the screen shot 

 

String_0-1691236919999.png

 

6 REPLIES 6

SANDEEP28
Mega Sage

@String Checkout below community post

 

https://www.servicenow.com/community/developer-forum/how-to-disable-submit-button-on-the-form/m-p/15...

 

 If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !! 

Hi @SANDEEP28  thanks for your quick reply .

am  using scope application and code is not going to if condition 

 

function onLoad() {
   //Type appropriate comment here, and begin script below
  alert("Hiding Submit button");
var items = $$('BUTTON').each(function(item){
if(item.innerHTML.indexOf('Submit') > -1){
 alert("Hiding Submit button inside");//not getting this alert 
          item.hide();}
});}
 
Please guide

SANDEEP28
Mega Sage

@String  add below code  for submit button and make sure "Isolate script " checbox is uncheck on the client script.

 

function onLoad() {
    g_form.addInfoMessage("Hiding Submit button");
    var buttons = document.getElementsByClassName("form_action_button header action_context btn btn-default");

    for (var i = 0; i < buttons.length; i++) {
        if (buttons[i].id == 'sysverb_insert') {
            buttons[i].hide();
        }
    }
}

  If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !! 

Hi @SANDEEP28  still no luck ,Please check the below screenshots 

 

String_1-1691242288119.png

 

form :

String_2-1691242306742.png