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

Form validation issue with single-line limit #1997

Open
strandofgenius opened this issue Jul 31, 2024 · 1 comment
Open

Form validation issue with single-line limit #1997

strandofgenius opened this issue Jul 31, 2024 · 1 comment

Comments

@strandofgenius
Copy link

Describe the bug

Having a form submission method set as page-reload and single-line is added to a form and the value has more than a set limit or as the default 255, the page refreshes and takes the user back to the top of the page rather than focusing on the field that caused the error. Also the styling of the form input error message doesn't match other fields and the form error message "Couldn’t save submission due to errors." does not display.

Page Reload Method
Screenshot 2024-07-31 at 10 39 51 AM

Ajax Method
Screenshot 2024-07-31 at 10 50 33 AM

Steps to reproduce

  1. Create a form with a single-line text field
  2. Set the form submission type as Page-reload
  3. Submit a form with too many characters in the single-line text field

Form settings

  • Multi-page form: No
  • Submission Method: Page Reload
  • Client-side Validation: Yes, but it happens either way
  • Custom Form Templates: No

Craft CMS version

4.10.4

Plugin version

2.1.20

Multi-site?

No response

Additional context

No response

@strandofgenius strandofgenius changed the title Form validation issue with single-line max limit Form validation issue with single-line limit Jul 31, 2024
@engram-design
Copy link
Member

I will say that we've revamped validation in Formie 3 (for Craft 5) to provide much-needed conformity between server-side and client-side. This however is a breaking change for Formie 2. I know that changing one of these styles is a "fix" for this issue, but it's also a breaking change for a point release.

As for scrolling to an error, at the moment that's restricted to an Ajax form, where we have control over the form submission process. I'm hesitant to include this functionality (scrolling to the first error on page load) when the page is loaded for fear that it might mess up some sites where they want control over the scroll behaviour for some reason. I'll give it some thought though.

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