Disable add attachment button in Nintex Forms

  • 4 September 2015
  • 5 replies
  • 27 views

Badge +1

Hi,

I have a form with Attachments area. I have disabled the attachment area depending on a rule. It seems to work, because the area is grayed out, and the two buttons "Add attachment" and "Delete" seems to be grayed out too. If I left click on both buttons, nothing happen, which is great.

The problem is if you do a right click on one of these button...If you right click on "Add attachment", and select "Open", the popup for adding attachment is displayed.

Is there a way to solve this bug ?

Thank you four your help


David


5 replies

Badge +5

if i don't want attachments in this form, i would remove it from the form itself.

select the title and the control and click the magical button "delete".

Badge +6

David,

You could also add the Attachment control to a panel and conditionally hide the panel, based on the same conditions that you have placed on your attachment control. I assume that there are conditions under which you would like to have people add attachments, hence not deleteing the control altogether.

Cheers,

Mark

Badge +1

Hi Mark, thank you for your answer.

I don't want to hide the whole Attachment control, just the two buttons "Add Attachment" and "Delete". I just want to give some restricted contributors the right to read the attachment, but not the right to delete it. or add a new one.

Thank you again

David

Badge +16

‌ did you resolve this in the end?

Badge +1

Hi,

yes I handle it with CSS/JS

First you need to apply all Nintex rules in you form.

Then hide all attachments links by adding this in your CSS code

.nf-attachmentsRow .nf-attachmentsLink[disabled="disabled"],
.nf-attachmentsRow .propertysheet[disabled="disabled"] {
display: none !important;
}

Finally add this JS in the JS part of your form to enable the "add attachment" button

function enableAttachmentLink(isDisabled){
   NWF$("table.nf-attachmentsTable td.ms-vb > a").removeAttr("disabled");
}
 
NWF$(document).ready(function(){

 NWF.FormFiller.Events.RegisterAfterReady(function(){ 
     setTimeout(enableAttachmentLink(true), 900);
  });
})

hope this helps ?

Reply