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

Disable Attachments on portal form

Tapish Sharma1
Kilo Sage

Hi Folks,

I am trying to hide the Attachment paper clip from the form, but it is not working on portal. I tried onload g_form.disableAttachments(). Attaching the screenshots - Any help would be great!

find_real_file.png

1 ACCEPTED SOLUTION

Maik Skoddow
Tera Patron

Hi @Tapish Sharma 

the most simple way is hiding the paperclip icon via CSS. You have different places where to add the required CSS.

For example open the page instance via holding the Ctrl key pressed and right-clicking anywhere in the page. Then select "Instance in Page Editor"

find_real_file.png

 

Then scroll down to the CSS field:

find_real_file.png

 

and enter:

sp-attachment-button,
sp-attachment-button ~ span {
       display: none;
}

 

Kind regards
Maik

View solution in original post

2 REPLIES 2

Maik Skoddow
Tera Patron

Hi @Tapish Sharma 

the most simple way is hiding the paperclip icon via CSS. You have different places where to add the required CSS.

For example open the page instance via holding the Ctrl key pressed and right-clicking anywhere in the page. Then select "Instance in Page Editor"

find_real_file.png

 

Then scroll down to the CSS field:

find_real_file.png

 

and enter:

sp-attachment-button,
sp-attachment-button ~ span {
       display: none;
}

 

Kind regards
Maik

PavanK960672992
Mega Patron

Hi Tapish Sharma,

1. If it is a form widget clone the widget and comment the code(line 61-66) as shown below image.

find_real_file.png

2. Create a page and select the updated widget(copy of form) as shown below.

find_real_file.png

3. On the behavior section select the page that created as above.

find_real_file.png

4. Then it will look like below without attachment icon.

find_real_file.png

Hope it helps!!

Please Mark Correct/helpful, if applicable, Thanks!! 

 

Regards

Pavankumar

If it helps please click Accept as Solution/hit the Thumb Icon.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar