- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2016 01:37 PM
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();
}
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2016 09:10 AM
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';
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2016 09:10 AM
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';
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2016 10:18 AM
Thanks Abhinay, it worked
Another interesting thing that i noted was the below error. Some g_form is being recognized in catalog client script. I have used hundreds of times but never saw this error.
I even tried below but didnt work
var g_form=new GlideForm();
g_form.disableAttachments();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2016 10:38 AM
GlideForm is not defined. What exactly you have in client script right now?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2016 10:44 AM
Your code is working fine but I am curious to understand as to why g_form.disableAttachments() is not working. It is giving glideform not defined error as shared above.
function onLoad() {
//Type appropriate comment here, and begin script below
//var g_form=new GlideForm();
g_form.disableAttachments();
//document.getElementsByName("Attachments...").remove();
//$('sc_attachment_button').hide();
/*
var list=document.getElementsByTagName("img");
for(var i=0; i<list.length; i++){
if(list[i].title=='Attachments...'){
list[i].style.display='none';
}
}
*/
alert("Attachment disabled...");
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2016 11:44 AM
That is strange. It is working as expected on my instance. Sorry, I really do not know what to say, since it is an out of box object which is not working. Did you make any changes to these UI pages?