g_form.disableAttachments not working

Bharat23
Kilo Guru

I wrote below script in an onload client script on a catalog item but I still see the paper clip icon. Any ideas??

Running on Eureka patch 11

function onLoad() {

    //Type appropriate comment here, and begin script below

    g_form.disableAttachments();

}

1 ACCEPTED SOLUTION

In Eureka, it is not a button. My script works post Eureka. Use this in your client script



var list=document.getElementsByTagName("img");


for(var i=0; i<list.length; i++){


if(list[i].title=='Attachments...'){


list[i].style.display='none';


}


}


View solution in original post

14 REPLIES 14

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Bharat,



Can you keep alert statement and check script is trigger or not?


Hi Pradeep,



I checked with alert and it does come up but still the attachment paper clip icon is visible and enabled. Any idea?



find_real_file.png


You can see the paperclip icon, but you cannot add any attachments. When you click paper clip icon, this is what you get


find_real_file.png


If you want to hide that icon too, use this line in the client script


$('sc_attachment_button').hide()