camelcasetechsd / certigate

0 stars 0 forks source link

[Production Issues] 03 Nov #226

Closed babanesma closed 7 years ago

babanesma commented 7 years ago
zhibek commented 7 years ago

The problem here is that browser security does not allow us to pre-select a file in the upload field on page load. So if the form is submitted (i.e. JS validation doesn't stop the page reloading) then it's impossible to set the file when the page is loaded again.

Ref: http://stackoverflow.com/questions/4205634/restoring-the-value-of-a-input-type-file-after-failed-validation

While we can't resolve this issue directly, we could change the functionality to prevent it being a problem: 1) Enhance client-side validation on this form so few/no cases exist where we rely on the form being submitted and the page reloaded. Currently, every basic validation error I'm trying in the from is caught by HTML5/JS so possibly this is close to being the case already?

2) Change the file upload fields to be AJAX file uploads where the file is uploaded at the time its selected (rather than on form submit). This will involve adding a plugin to allow AJAX file uploading.

@babanesma @ahmedelbougha What are your views on this.

zhibek commented 7 years ago

@babanesma PR #234 created and assigned to you.

babanesma commented 7 years ago

@zhibek