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

Footer newsletter sign up displays errors from contact form #1917

Open
pm-zr opened this issue Aug 16, 2022 · 2 comments
Open

Footer newsletter sign up displays errors from contact form #1917

pm-zr opened this issue Aug 16, 2022 · 2 comments

Comments

@pm-zr
Copy link

pm-zr commented Aug 16, 2022

Describe the current behavior

If the contact form is unsuccessfully submitted the footer newsletter signup displays the error from email field for the contact form

Describe the expected behavior

errors for each form would be isolated to the form submitted.

Version information (Dawn, browsers and operating systems)

  • Dawn Version: 6.0.2

Possible solution

Check for form.id when displaying errors to ensure the error is from the form in question. There may be other ways to handle this.

Additional context/screenshots

Visit this link to reproduce on the demo store: Demo store submitted form

@pm-zr
Copy link
Author

pm-zr commented Aug 16, 2022

Can't upload a screenshot for some reason right now, link above will reproduce. Or just submit a blank form, complete recaptcha if needed.

The default error state of a form field also seems to need some more thought. It seems to be incompletely styled on the demo store.

@shawnr42
Copy link

There is no form.id that can be used as a way to make sure that the error applies to a specific form.

My current workaround is to check for a field besides the email field that I know is the in the contact form. For the contact form I use form.Name for the name field on the form.

That means that on the Newsletter section, instead of just looking for an error like this

{%- if form.errors %}

and instead, check for the errors, and that there is no "Name" field content.

{%- if form.errors and form.Name == blank -%}

It's not perfect, but it can help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants