If you haven’t seen Nintex Forms, go and either download a trial or a hosted trial. You’ll find that if you have any number of fields in your list and generate a Nintex Form for it, it will automatically generate a visually appealing, user friendly form. It’s a very quick and easy way to have a nice form for user.
As part of a form for a List or even for a Task, a user can attach one or more documents.
What if you want a user to ALWAYS attach a document, and you don’t want to allow a user to be able to complete the form without an attachment?
The easy way I found to do this, would be to create a custom validation function, link it to one of your fields (ie. the Title field). If someone fills in the form and presses Save, the validation function will be called and if there’s no attachment, validation will fail and the Save will not be allowed to proceed.
The following is the most simple Nintex Form, based on a list with just a Title field.
function validateAttachments(source, arguments)
var elm = document.getElementById("idAttachmentsTable");
var elmAttachmentRow = document.getElementById("idAttachmentsRow")
if ((elm != null && elm.rows.length > 0) && (elmAttachmentRow != null))
arguments.IsValid = true;
arguments.IsValid = false;
In the above example, I just put in a title value and presses Save. You can see the message is telling us that either the data is invalid or you haven’t added an attachment to this form.
Below, you can download this form and use it on a SharePoint Custom List with just a title field. It’s a very simply form and I didn’t bother with sharing a List Template, since you can just go to create a Custom List and then import this form.
Form Design: Download Form Design