Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Textarea - Non-Scrolling

Status
Not open for further replies.

teblack

Programmer
Apr 30, 2004
45
I have a text area that I would like to only allow a certain number of lines and characters per line.

ie. 2 lines of text input, each line can contain up to 80 characters. I seems to be able to get the 80 characters, but can not seem to only limit the box to 2 lines. Once I keeping typing I'm allowed to key values on lines 3 & 4 and so on, which I don't want. Any suggestions.

Code:
<style type="text/css">
textarea {
overflow:auto;
}
</style>

<form METHOD="post" ACTION="default.asp" name="FormsQuestion_Form"> 
<p>
Please tell us why you no longer wish to receive these forms electronically (optional):
<p>
<textarea name="formsreason" cols="80" rows="2"></textarea>
[\code]


Thanks in advance for the help.

TBlack -
 
M.Brooks,

Added it into the style sheet, and does not effect the textarea box. Still allowing multiple lines...





TBlack -
 
Are you trying to use the maxlength property of the input field on the textarea, so limit the input in the textarea to certain number of characters? If it is that what you want, you will need to employ a javascript solution, since HTML does not support limits on characters in a textarea. JS forum216.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top