Attachment button not working on InfoPath Form for SharePoint 2016
-
08-02-2021 - |
문제
I have created a custom InfoPath form with an attachment button.
When the last drop-down is yes then only the attachment section appears.
The problem is when this is clicked, a grey overlay appears which doesn't allow anything to be clicked within the page at all.
해결책 2
So making changes to the permissions didn't work at all. In the end, I did a little bit of a workaround which didn't involve InfoPath at all.
I created a piece of Javascript which I added to NewForm.aspx and EditForm.aspx, which stops users from saving if no attachment is present
script type="text/javascript" language="javascript">
function PreSaveAction() {
if (document.getElementById('idAttachmentsRow').style.display=='none' )
{alert('Attachments are Mandatory! Please attach the relevant Self-Assessment Checklist using the Attcah File button at the top of the page.');
return false ;}
else { return true; } }
/script>
다른 팁
This seems to be a permission issue and known issue in infopath form.
This is an issue with InfoPath and SharePoint permissions.
When you use the attachment control on a SharePoint list that has been customised to use an InfoPath form, the attachment control behaves differently than to the default out-of-the-box SharePoint list form..
The user needs both "Add New Item" & "Edit Item" Permissions to use the Attachments control on an InfoPath customised SharePoint list form.
These permissions are not enough to allow SharePoint list Attachments with a customised InfoPath form (but are enough for a default SharePoint list with no InfoPath customisations):
Similar question is discussed below :
File attachment button on InfoPath form not working for user but works for me?