I have a list where I use Infopath Forms. Users use these forms to enter data. They should also attach something in the form, but if they don't attach anything and click save, I want that the item is not saved, but a textbox becomes visible where they have to write the reason for not attaching a file. I have not found a way to accomplish this out of the box in InfoPath or SharePoint Designer 2013. I also have not found a way to enter client side code with JavaScript in InfoPath. I also don't have the possiblity to add a Content Editor web part.
Is there a way to implement this validation logic in InfoPath?

1 Answer 1


If I understood you correctly, you just need to make your attachments mandatory, right!

So in this case, you can do the following:

  • In your data source, Right-click the attachment field, and select Properties

  • At Validation, set

    Attach is blank

Read more at how to make attachments mandatory in InfoPath,. Also, you can find another workaround at Make attachment field mandatory in InfoPath

  • No. It is not just making the attachment mandatory, but to make another control (a textbox) visible, prevent the form from closing and force to the user to enter a text, if the attachment field is blank when the user tries to save the form.
    – Code Pope
    Mar 29, 2022 at 18:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.