Welcome Guest, Not a member yet? Register   Sign In
How to restore file_upload value on error?

[eluser]James Spibey[/eluser]

I'm trying to figure out the best way to retain the value of a file upload field between postbacks of a form. The problem I have is that the field isn't 'required' and so if they post a form and it fails validation, it isn't clear that they need to upload the file again.

Has anyone come across this?



you could check if a file was uploaded and on error you could highlight the file field to make sure people add the upload again.

spib, it's important to note that file upload fields don't have a value="" attribute, so you can't repopulate it. xwero's suggestion is spot on and probably the best way for you to keep users from getting too confused.

[eluser]James Spibey[/eluser]
Thanks guys. In the end I did pretty much as suggested but also added a banner at the top of the page explaing that they need to re-select the file to upload

Theme © iAndrew 2016 - Forum software by © MyBB