![]() |
Form: Keep Files even though validation fails - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Form: Keep Files even though validation fails (/showthread.php?tid=78870) |
Form: Keep Files even though validation fails - paulfst - 03-20-2021 Hello together, I have a specific question. I am currently working with the forms in CI4 and it works perfect. I've build a lot of Validation into my form. I also managed to keep the values, even though the validation fails. Sadly, this doesn't work for pictures. Now the problem is: In my case, the form has 12 pictures which are taken by the while the fill in the form. If the validation fails because they miss a value or something, all the pictures are gone, since they aren't uploaded before you hit the submit of the form. My question is: What is the best way to deal with this, so that the users dont need to re-take all pictures if validation fails? Is it possible to upload the pictures as soon as they are taken (even though before the submit event is fired)? If so, space on the webserver is no issue, since those pictures are cleaned via a cronjob every few days. Or is there a better way I am missing? I am helpful for any suggestions or points into the right direction! Thanks a lot, Paul RE: Form: Keep Files even though validation fails - iRedds - 03-25-2021 Use AJAX RE: Form: Keep Files even though validation fails - demyr - 03-25-2021 Do you mean you need something like "dropzone" ? |