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

Incorrect max length validation on text areas #1675

Closed
LeonBatch opened this issue Dec 10, 2024 · 2 comments
Closed

Incorrect max length validation on text areas #1675

LeonBatch opened this issue Dec 10, 2024 · 2 comments
Assignees
Labels
issue Something isn't working correctly

Comments

@LeonBatch
Copy link

LeonBatch commented Dec 10, 2024

What happened?

Using a text area field, if you enter in the max amount of characters as specified within the freeform "Max Length" settings it correctly restricts you to the max length (1500 for example) however upon submission i get the following error:

Value must be no more than 1500 characters

I don't think it is accounting for new lines and special characters.

Screen Shot 2024-12-10 at 3 45 50 PM Screen Shot 2024-12-10 at 3 46 00 PM

Errors and Stack Trace (if available)

No response

How can we reproduce this?

  1. Create a text area field with a max length of 1500
  2. Enter in 1500 characters on the front end and submit
  3. See error

Freeform Edition

Pro

Freeform Version

5.6.8

Craft Version

5.5.0.1

When did this issue start?

Unsure

Previous Freeform Version

No response

@LeonBatch LeonBatch added the issue Something isn't working correctly label Dec 10, 2024
@kjmartens
Copy link
Contributor

Thanks @LeonBatch,

We'll check into this and see what we can do. 🙂

@seandelaney
Copy link
Contributor

seandelaney commented Dec 11, 2024

@LeonBatch

Line breaks, spaces and tabs all are counted as characters in PHP validation checks. The database will also count these as character too.

The error you get is correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue Something isn't working correctly
Development

No branches or pull requests

3 participants