Skip to content

Form data is not persisted when validation is not met #100

@MaxwellGarceau

Description

@MaxwellGarceau

Is your enhancement related to a problem? Please describe.

When filling out a form, if a user does not pass a validation check then the entire form will be lost. This is with JavaScript support enabled.

form-data-lost-on-validation-fail.mov

Designs

Non JavaScript solution - will work with or without JS

We can repopulate the <input> fields on failed submission with the submitted value from the $_POST variable in the mailchimp_form_field function.

JavaScript is enabled (optional)

  • Option 1: We can store the in progress form data in local storage
  • Option 2: We can validate form submissions on the FE to avoid clearing form data when it hits the BE

Describe alternatives you've considered

Considering that a user could become frustrated and leave without re-attempting form submission I think this is worth fixing.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions