Frontend form: retain local file selection when form validation fails on other field
This is an open discussion with 4 replies, filed under General.
Search
As far as I remember, you can't achieve this. This is a browser thingie (security). There has been a longer discussion about it (either here or on GitHub), maybe you can find it.
Thanks Michael, I wasn’t able to find it. If the answer is »no« I’m accepting :(
I guess helper style validation using JS on top of the backend server side validation may reduce the amount of errors prior to sending and losing that data.
Just inform the user as much as possible on what will happen I guess.
Thanks Andrew, good points!
Create an account or sign in to comment.
I have a frontend form with a
multiple upload field
and some other fields.My problem is that when any other missing/invalid field stops the entry from being created I am not able to recreate the state of the
input[type=file]
-fields, thus the user would have to reselect his files.I do get useful looking data in the
post-values
but using thefile
-node as value is not working:Has anyone tackled this before? I’ve only found posts about editing entries, but not about not-yet-created entries.