verbb / formie

The most user-friendly forms plugin for Craft CMS.
Other
93 stars 69 forks source link

Upload field gets emptied on page change #1856

Open Megafry opened 1 month ago

Megafry commented 1 month ago

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

Craft CMS version

4.8.10

Plugin version

2.1.13

Multi-site?

No

Additional context

No response

engram-design commented 1 month ago

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).

anchovy commented 1 month ago

Hi - we've got the same issue.

engram-design commented 1 month ago

@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.