Solved

Can we require the user to view an attachment before submitting form?

  • 14 December 2017
  • 13 replies
  • 20 views

Badge +5

This was something we could do with Winshuttle.

icon

Best answer by cdsommerfield 15 December 2017, 21:59

View original

13 replies

Badge +9

Is there a hyperlink or something on the form? You could add a JS hyperlink button with onclick that opens up the link to the attachment and also onclick writes to a required field.

Badge +9

I was curious so I went ahead and tried this out myself, works pretty well.

  1. Make a hidden field and give it a JS variable name of "AttachmentRead" 
  2. Create a validation rule that it cannot be empty, if empty "Please reach the attachment"
  3. Create a JS button hyperlink (or really any will work, depends how you want it to look)
    1. Give it a label of "Must Read this Attachment Before Submitting"
    2. Under advanced section, add the following JS to the Client Click Replace google with the link to your attachment
      NWF$(document).ready(function(){      AttachmentRead();  }); window.open("https://www.google.com");

  4. In the custom JS under form settings add this codeNintex Forms for Office 365
    function AttachmentRead () { 
      NWF$('#' + AttachmentRead).val("Read"); 
    }
Badge +5

But can that be done in office 365?

Sent from my iPhone

Userlevel 5
Badge +12

Hello,

You can always make it a task that the user has to complete, saying essentially "Yes I did review the document".    This would be part of a workflow following the submission of this form.

Thanks

Mike

Badge +9

Yes. I just did it in O365

Badge +5

Can the url be a variable?

Badge +9

You could make a JS variable; but you'll have to know the exact URL for each variable. In the form settings custom JS section you can add references from the right, but you're limited to what Nintex has there.

Badge +2

Hi Chadd,

For some reason this isn't working for me. When the user first clicks on the link it immediately has 'Please read the attachment' pop up, then when you click on the link a second time it then opens the attachment. The next issue is when trying to submit the form, even after viewing the attachment, it is still saying 'Please read the attachment' and not allowing the user to submit. I included images in hopes you can let me know what I did wrong. Thanks!

Badge +9

Hey Laura! Let me recreate it and take some screenshots for you. I'll try to get back to you as soon as I can!

Badge +2

Thank you so much!!!

Badge +9

Hey Laura,

Actually try following my blog post. It goes into more detail. Make sure when you hide the field, you use CSS to hide it. Visible = no won't work.

https://chaddtalks.wordpress.com/2017/12/21/require-a-user-to-view-an-attachment-before-submitting-a-nintex-form/

Badge +2

Thanks so much Chadd!

I followed the instructions, but unfortunately it's now not opening the link when being clicked. It's just stating “Must Read this Attachment Before Submitting”. Here are my screenshots: Also because it's hard to view if I screenshot it, here is what I copied and pasted for creating a hyperlink for the JS button:

  • Create a JS button hyperlink (or really any will work, depends how you want it to look)
    1. Give it a label of “Must Read this Attachment Before Submitting”
    2. Under advanced section, add the following JS to the Client Click Replace google with the link to your attachment

NWF$(document).ready(function(){      AttachmentRead();  }); window.open(“https://www.google.com“);

NWF$(document).ready(function(){      AttachmentRead();  }); window.open(“https://one.mskcc.org/sites/pub/radiology/_layouts/15/WopiFrame2.aspx?sourcedoc=/sites/pub/radiology/lptestapp/powerpoint%20insulin%20pens%20%281%29.ppsm&action=default“);

Badge +9

For the rule, try {Self} = ""

Also, Nintex doesn't like it when code is copied from a different site. Try copying the code and pasting it in Notepad first, then copying from notepad to Nintex. Everything else looks right so I'm not sure why it's not working.

Here is what mine looks like

Here's what's in the button

Reply