formie icon indicating copy to clipboard operation
formie copied to clipboard

Upload field gets emptied on page change

Open Megafry opened this issue 1 year ago • 3 comments

Describe the bug

On page change with a multi-page form the upload field gets emptied This is inconvenient as the user does not know whether the document is still linked or not

This also happens when the submission method is set to page reload

Steps to reproduce

  1. Create a form with 2 Pages
  2. Add an upload field to the first page
  3. Open the form in the frontend
  4. Add a file to the upload-field
  5. Go to the page 2
  6. Go back to the page 1
  7. the field is empty even though the file is in the submission and already uploaded to the server

Form settings

  • Multi-page form: Yes
  • Submission Method: Ajax
  • Custom Form Templates: No

Craft CMS version

4.8.10

Plugin version

2.1.13

Multi-site?

No

Additional context

No response

Megafry avatar Apr 30 '24 09:04 Megafry

While this is certainly true for an Ajax-based form, for a Page Reload one, it should show the uploaded asset in the field.

image

With Ajax-forms, there's no re-rendering of the field once the files have been uploaded, so that's something we'll have to look at. We have on the roadmap to provide a better, more modern approach to file upload fields, as currently it's incredibly basic and makes things like managing uploads impossible (thanks to browsers).

engram-design avatar Apr 30 '24 14:04 engram-design

Hi - we've got the same issue.

anchovy avatar May 08 '24 02:05 anchovy

@anchovy To confirm, it's an Ajax-based form for you? There's no re-rendering of the field once the field has been uploaded in that instance until the page is refreshed. We'll need to somehow implement that, or look at adding a proper drag-drop file uploader field, as we can't populate the file input.

engram-design avatar May 08 '24 04:05 engram-design