Even though the fields are set to mandatory they can be skipped before submitting the page(just don’t activate the field on the page).
Any good ideas to prevent the form to be submitted before all fields has be validated and filled
properly? The form contains of up to 30 fields, and I need to make sure that at least 28 of them is correctly filled, there is a lot of validation on each of the fields, but as stated they can be skipped.
I thought of using a bunch of true/False variables, or a sort of counter, so as soon as the value changes on each of the fields the counter is incremented or the boolean changes from false to true, but maintaining 30 booleans seems a bit overkill.
for example if you are trying to type Firstname, if you check that condition it will goes to next type activity to enter the further things or else it will throw the error
and have a preview in which direction such a dynamics can go. But keep also in mind that this check has to be triggered multiple times (e.g. on the different field updates) or maybe you will set it to validate button which will trigger the submit button enable/disable to get it centralized
if you want to verify each single field booleans would be a good reference. Think about, that maybe some fields only can be filled, when others are filled already. If so you can skip the validation of the fields before.
My Suggestion would be to Store all the Booleans in a Dictionary, so you can handle the final condition with “For Each Key-Value-Pair”