Hello WebForm Guru's
I have a problem with using file fields on webform along with basic "required field" validation.
Setup:
A webform with 2 file fields (lets call them file1 and file2) both set as required.
Problem:
I select a file for uploading in file1 field and then submit the form without selecting one for file2. I get sent back to the form displaying the required field error and the file2 field is highlighted. This behavior is expected. However, file1 that I had selected a file for is now empty. So if the a user just fills out the highlighted field (file2) and hits submit it will error again since the file1 field now has nothing in it. The kicker being that file2 is now empty as well.
Is this expected behavior? Is there a way I can get webform to remember the value of that field?
Thank you,
Comments
Comment #1
quicksketchThis is essentially an unsolvable problem in Drupal 6. HTML in general does not allow you to set default values on input type=file fields, so we can't restore the already-selected file after a validation error. In Drupal 7, this has been mitigated by using AJAX-based uploader provided by Drupal core (but it still isn't able to set a default value if the file was not AJAX-uploaded).
This problem has already been marked won't fix in #322786: File attachment lost after validation error, since the problem is largely fixed in D7 but doesn't have any way to backport to D6.
Comment #2
vincetingey commentedHmmm bummer. Thank you for the prompt response!