What is the best way to validate a huge form with 10 image uploads ?
I have a project where I have a form with 10 image uploads and 15 fields.
The user may find it difficult to complete the form in a single sitting. So I am trying to give him/her a SAVE button on the first attempt. After that he/she can update the form ( in as many attempts as he/she may wish ). Finally there is a button for "FINAL SUBMISSION". But how I will do the complete validations of all the fields ?
Introduce a is_draft column to wherever you are storing the form.
For the validation, you can specify what fields are required when submitting the form like this
Thanks for your time. But kindly elaborate a bit. I am not doing any validations during first SAVE and during UPDATES. I want ti validate only when the user clicks FINAL SUBMISSION button. So how I will validate when the update form is having values from the already stored values.
The user may find it difficult to complete the form in a single sitting. So I am trying to give him/her a SAVE button on the first attempt. After that he/she can update the form ( in as many attempts as he/she may wish ). Finally there is a button for "FINAL SUBMISSION".
This is what I want to do. Just looking for a better solution. Images cannot be uploaded at one go as they all are for different fields and some are optional depending on a condition. Its actually an application for for students.
My issue is that how will I validate the fields at the time of FINAL SUBMISSION.
I know I can make a form and do all the validations at one go but the student will find it difficult to upload so many documents at one go. That's the whole purpose.
@FounderStartup you cannot validate files at final submission since you must store them when submitted ( and validate at that time) so for these, that are required, you are going to need some additional state that tells you that attachment 3 has been validated and stored
You are probably going to need a complete draft submission model that you can allow the student to start to complete, recording each field as it is posted, with nothing required. Then when the final submission occurs you will need to check that you have all required fields
@Snapey Thanks for understand the whole issue :). Is it a better idea to break the form in 3-4 parts and every part has to be submitted with complete validations ?
@FounderStartup For the user, yes, that is generally a better idea. It’s easier and more overseeable to have five smaller forms to fill out than one massive form.
You should still have a Save functionality that allows the user to fill out some forms, then come back later and fill out the rest if they discover there’s a document they’re missing and have to obtain first, for example.