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 7599895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:46:23+00:00 2026-05-30T22:46:23+00:00

We have a form that lets people input html formatted text and that input

  • 0

We have a form that lets people input html formatted text and that input is then displayed elsewhere on the webpage.

Due to layout constraints the input may not be longer than X lines. There is no preview of the edited text in the webpage. Input upon submit is immediately published. (Short Explanation why I cannot fix the layout: the text in question is displayed as an overlay above an image. The overlay has about the size of the image and that is fixed. The text should be completely visible inside that overlay and should not spill over.)

I am being asked to implement something to keep people from entering too much text.

My first try was going for “maxLength” but goes wrong because of the possibility html formatting of the input.

Besides the obvious two 1. expecting users to be smart and/or 2. implementing a preview method, how else could we possibly solve this?

I am out of ideas, I’ll also accept an explanation why it is impossible

Technology used: java, wicket 1.4.x

  • 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. Editorial Team
    Editorial Team
    2026-05-30T22:46:25+00:00Added an answer on May 30, 2026 at 10:46 pm

    I’m not a web-development expert so this may not be a precise enough answer.

    Using javascript you can get the effective size of an HTML element once it has been rendered in the browser. Thus, one solution could be to render the page server-side, and check whether the result exceeds the size you expect.

    This may not guarantee a correct result however because the server may render the page differently than the client. You could also always accept the input, then when the client renders the page, have a snippet of javascript that checks (client-side this time) whether the rendered result is okay. If it isn’t, then let javascript redirect the client to an error page so that it can edit his input.

    What I’d do however is to change the layout so that nothing breaks if the user enters too much text. Using the CSS overflow property could be a start. You could also implement better solutions in javascript such as dynamically changing the text size until it fits the size you want.

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

Sidebar

Related Questions

I have a form that lets the user enter in some text. It will
I have an HTML form that lets the user write what they want to
I have an admin form that lets users create entities that require an image.
I have a form that people can use to send emails to our clients.
I have a form that lets users upload a image of them self. I
So I have a form that lets a user create a new team. Our
I have a post type that lets people add an event, including the usual
I have a main form that is launched and then it can go to
I have a form that lets users select checks, and when submitted, creates a
I have a form that lets the user to either add an employee's details

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.