0

I want to create a preview field for a text which I want to print later. The text in the preview is written by the user. The thing is that the text is not allowed to exceed over 7 rows and 33 columns (I defined those 7 rows and 33 columns in my textarea where the user inputs his text). In short: User writes text which gets submitted to the webservice -> text is saved in database -> on request the text will be shown on the html site and printable, condition: the text is not allowed to be larger than the 33 columns and 7 rows. I wanted to use a text field for this task now where I can define this special height and width, so that the text which overflows is simply not display, so that the user recognizes that there is too much text written. If there are understanding problems please tell me :)

1 Answers1

0

You should use maximum number of length for text, instead of setting a certain number of columns and rows in textarea.

If you are interested in using maxlength then have a look here: How to impose maxlength on textArea in HTML using JavaScript and Limit number of lines in textarea and Display line count using jQuery.

Community
  • 1
  • 1
Hasib Mahmud
  • 806
  • 1
  • 10
  • 29