Actions
Bug #5599
closedValue reset for file inputs does not function properly
Description
Resetting the value of a file input causes the input to break on initial submit resulting in no file selection submitting.
Actions
Added by krileon about 9 years ago. Updated almost 9 years ago.
Description
Resetting the value of a file input causes the input to break on initial submit resulting in no file selection submitting.
To test condition avatar to show on a field value equaling a specific value while the avatar field is required. Initial display should be hidden. Now cause it to display and attempt to upload. Required validation error will then be thrown.
Set a file field to required, condition it to show based off another fields value, attempt to register and toggle its display, registration will fail with a required error, turn off value reset, retest, it now works fine. The issue appears to be entirely related to the jQuery doing the value reset.
Disabling value resetting works around the issue for now, but you lose value resetting functionality.
It's due to the __choice input being reset then on upload there's no choice selected resulting in the upload failing as the __choice was changed from "upload" to empty. Hidden inputs shouldn't have their values reset.