kjac / FormEditor

A form builder editor for Umbraco 7 - let your editors build forms easily with this free package.
MIT License
99 stars 42 forks source link

Validation for fields affected by "Actions" #173

Closed uniquelau closed 6 years ago

uniquelau commented 6 years ago

When mandatory fields are used with "Actions", it is easy to create a form that will not submit, because there are times when its state is not valid.

Example

Name (textstring, mandatory) Occupation (dropdown, mandatory) [programmer, plumber] Qualification level (dropdown, mandatory)

If all fields are completed the form will submit.

If we apply the following Action logic:

Field Occupation condition value = Plumber perform this action, Show the field *Qualification level".

Now, if the User selects "Programmer" as the dropdown option, they will never see the *Qualification level" field, and therefore never be able to submit the form.

Suggested fix

Only check field validity for fields that are visible.

kjac commented 6 years ago

@uniquelau couldn't you achieve the same thing with cross field validation and actions combined? Something along the lines of this tutorial?

I get where you're going with this, but implementing this in the clientside and serverside validations would be a nightmare... for starters just consistently figuring out what's visible on the clientside, not to mention figuring out what might have been visible when the submission hits the serverside.

uniquelau commented 6 years ago

Ah smooth! That does the trick perfectly 👍 thank you!