Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 157501
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T10:30:55+00:00 2026-05-11T10:30:55+00:00

Does anyone have good suggestions for displaying max length exceeded errors to a user

  • 0

Does anyone have good suggestions for displaying ‘max length exceeded’ errors to a user when a single character doesn’t equal one byte?

I’m at a loss for words, but I found a quote that’s more eloquent:

If the buffer runs over by three bytes, what do you tell the user? Three bytes could be one, two, or three characters that the user needs to trim. Depending on which characters they trim, the result might still be too long. And recall that the user’s perception of ‘a character’ is probably closer to a grapheme or grapheme cluster than to a character. So they might delete too many characters without realizing it. Finally, if the buffer limit is small (like 10 or 20), some languages like Chinese will be severely restricted on the number of characters permitted.

A couple of constraints I’m under is that its a form-driven website and the underlying database columns sizes can’t change (the quote-page suggests having a 40byte buffer and enforcing a 10character limit).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T10:30:56+00:00Added an answer on May 11, 2026 at 10:30 am

    My favorite way to solve this problem is to highlight the portion of the input that exceeds the maximum length. This provides a visual cue as to which part makes it ‘too long’, without having to get into the specifics of how many bytes or characters it was.

    If you can use Javascript (for example, if you don’t need to meet 508 standards), I also like monitoring the length of the field and alerting the user when it’s too long (while still doing server-side validation, of course).

    If you don’t want to get into complex CSS inside the input field, you can just reproduce the bad input below the field and highlight it there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 67k
  • Answers 67k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Maybe NHawk can help? 'NHawk is an initiative to provide… May 11, 2026 at 11:53 am
  • added an answer ifstream myfile (filename); should be: ifstream myfile (filename.c_str() ); Also,… May 11, 2026 at 11:53 am
  • added an answer If the two forms doesn't have a parent-dialog type of… May 11, 2026 at 11:53 am

Related Questions

Does anyone have any good suggestions for creating a Pipe object in Java which
Does anyone have any suggestions for a good approach to finding all the CPAN
Does anyone have a good way to build MSI (vdproj) projects using MsBuild or
Does anyone have some good hints for writing test code for database-backend development where
Does anyone have any good starting points for me when looking at making web
Does anyone have a good solution for integrating some C# code into a java
Does anyone have a good technique (or tutorial) to implement rulers within a C#
Does anyone have a good articles or tutorial on correctly using dispose and IDisposable.
Does anyone have any good links for developing custom field and content types that
Does anyone have a good algorithm for taking an ordered list of integers, i.e.:

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.