Issue
- I'm trying to complete a multistep form that's supposed to have seven steps.
- Some questions on the form are required, while others are optional.
- When I reach the final step and click 'Submit,' I get an error message saying 'This form is invalid. Check field.123456789.'
- This error prevents me from successfully submitting the form.
Environment
- DXP 7.3+
Additional Information
- Forms often include pages that can be skipped based on specific conditions.
- While this feature can improve user experience, it can also lead to unexpected issues.
- One such problem arises when mandatory fields are placed on skippable pages.
- If a user bypasses a page containing required information, the form cannot be submitted successfully.
- This is due to missing data in the required fields, even though the user may not have realized they were skipped.
Resolution
There are several approaches to address the problem of mandatory fields on skippable form pages:
-
Eliminate Page Skipping: Removing the ability to skip pages ensures that all required fields are completed before form submission.
This approach guarantees data integrity but might increase form completion time. -
Remove Mandatory Fields: By designating fewer fields as required, the form can be submitted even if certain pages are skipped.
However, this might compromise data quality as essential information could be missing. -
Provide Default Values: Assigning default values to required fields on skippable pages allows form submission without manual input.
While convenient, this solution might not always accurately capture the intended data.