How to hide the "Attach File+" button?

Hi Everyone,

Is there any way that we can hide the “Attach File+” from a document.

Regards
Ruchin Sharma

Go to Setup->Customize Form. From “Enter Form Type” select the document from which you want to delete Attach. From “fields” select that particular field, click on remove and update.

@KanchanChauhan

There is no such field available for this.

Regards
Ruchin Sharma

From where you want to delete this?

As it get displayed on every form but I want to hide this button from a specific form on a specific condition.

Regards
Ruchin Sharma

@ruchin78 this is a system wide feature not only module or form customized…
but you can find a way to add style in developer section to do:

.form-attachments { display:none;}

1 Like

@ramielian
Thanks for your reply.

but you can find a way to add style in developer section to do:

What does that mean?

Regards
Ruchin Sharma

@ruchin78 i mean you can do this by adding css from the developer section in the erp…

or you can edit master files and add the css…

1 Like

@ramielian

Thanks a lot but I really don’t have an idea about this.

Regards
Ruchin Sharma

@ruchin78: Hey, did u get the work around / Solution for your above mentioned query ?

@shahmunjal Try this code:

frappe.ui.form.on("Traget DocTypet", {
refresh:function(frm) {
		$('.form-attachments').hide(); 
	}
});
4 Likes

@Mohammed_Redha: Thanks for your help… it works. But can you tell me how can we restrict user to upload specific file type (*.pdf, *.doc) only ?

@Mohammed_Redha @erpnext_developer
Pls. help if we can restrict the user to upload specific file types only?

@shahmunjal try this :

Could you please show the directory / path where the above CSS code should be placed to remove Attach File +?

Hello,

Put it in the corresponding DocType script. (e.g. for Sales Invoice, go to the directory put it on sales_invoice.js)

Regards,

Ivan

Thank You Ivan!

It’s working.