I want to change the location of an attached file in a list. My list has multiple rows of information to fill out, but when you attach something to it, it places the attachment at the bottom. Is there any way to make the attachment go between a specific two rows when adding or editing a list item?
1 Answer
You could load some javascript on the form that gets the attachment row (id="idAttachmentsRow") and moves it to a different row.
Here is a basic example:
var attRow = document.getElementById("idAttachmentsRow");
attRow.parentElement.insertBefore(attRow,attRow.parentElement.children[1]);
For a detailed walk-through, you could check out Mark Rackley's post. He loads a custom HTML template and uses JS to move all the form elements into his custom layout. He also explains how to load the JS on the forms by editing the list forms.
Note: In my environment, the attachment row doesn't show on the form until I actually add an attachment with the ribbon. It is still there in the DOM so you can manipulate it with your script. By default, it is hidden when no there are no attachments.