Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve front-end form validation feedback #77

Closed
gaelpleeroy opened this issue Feb 8, 2023 · 2 comments
Closed

Improve front-end form validation feedback #77

gaelpleeroy opened this issue Feb 8, 2023 · 2 comments
Labels
Feature Request New feature or request

Comments

@gaelpleeroy
Copy link

I'm using a frontend form to populate an Address field (https://plugins.doublesecretagency.com/google-maps/address-field/front-end-form/#basic-input-fields)

But when the validation comes I get an error for the global address field, it would be nice that it detects what's missing and adjust the response accordingly. Like [address][city]: "The City is required"

Currently I get the following:

array(1) {
  ["address"]=>
  array(1) {
    [0]=>
    string(93) "The following subfields are required: **Street Address**, **City**, **Zip Code**, **Country**"
  }
}
@lindseydiloreto
Copy link
Collaborator

Interesting idea. Your front-end form is using the exact same validation as what you'd see in the control panel.

You're correct, the validation logic currently just compiles a list of all required fields. But perhaps it should only be reporting back the subfields which are required and invalid.

Thanks for the suggestion! 👍

@lindseydiloreto lindseydiloreto added the Feature Request New feature or request label Feb 9, 2023
@lindseydiloreto
Copy link
Collaborator

Good news, this change has been made in v4.3.3. Thanks again for the great idea!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants