By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,445 Members | 1,159 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,445 IT Pros & Developers. It's quick & easy.

TEXT AREA ROWS IN HTML

P: n/a
SSG
I have text area having 4 rows & 10 cols.. while I am typing in
Textarea , it should not accept the 5 th row & 11 th col...

Hw to create text area like that....

Jan 21 '07 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Scripsit SSG:
I have text area having 4 rows & 10 cols..
That's ridiculously small for almost all practical purposes. It's
conventionally used in "feedback forms" to indicate how little you care
about user input.
while I am typing in
Textarea , it should not accept the 5 th row & 11 th col...
You're wrong. By definition, as explicitly mentioned in HTML specifications,
textareas should accept an unlimited amount of lines of unlimited length.
Hw to create text area like that....
You can't. You need to check the amount of input in the server-side form
handler. You might wish to warn users about this. For more info, see
http://www.cs.tut.fi/~jkorpela/forms/textarea.html

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Jan 21 '07 #2

P: n/a
SSG wrote:
I have text area having 4 rows & 10 cols.. while I am typing in
Textarea , it should not accept the 5 th row & 11 th col...

Hw to create text area like that....
SSG,

You could replace the textarea with <input type="text" size="40"
maxlength="40">. That will limit the input to 40 characters AND will
give the user a correct visual clue regarding how much input will be
accepted.

As Jukka points out, 40 characters isn't much, so make sure your
expected data will actually be that small. One of my pet peeves (and, I
suspect, that of many others) is an input area that is too short for the
requisite data.

Chris Beall
Jan 21 '07 #3

P: n/a
Chris Beall <Ch*********@prodigy.netwrites:
SSG wrote:
>I have text area having 4 rows & 10 cols.. while I am typing in
Textarea , it should not accept the 5 th row & 11 th col...

Hw to create text area like that....

You could replace the textarea with <input type="text" size="40"
maxlength="40">. That will limit the input to 40 characters
"Limit" is too strong a word, I think. A cooperative browser will prevent
ordinary users from entering more than 40 characters. But, a hostile user
can easily use a noncooperative browser and/or a script to submit more data
than that to the server.

The internet being what it is, hostile users are in abundance, so depending
on the browser to enforce this so-called "limit" is a Very Bad Idea. By all
means, do include it - it's far more convenient for ordinary users to have
their browser limit their typing, than to submit the form and have an error
page come back. Just don't depend on it; double-check on the server to make
sure the browser did the right thing.

sherm--

--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
Jan 21 '07 #4

P: n/a
Gazing into my crystal ball I observed "SSG" <ss****@gmail.comwriting in
news:11**********************@l53g2000cwa.googlegr oups.com:
I have text area having 4 rows & 10 cols.. while I am typing in
Textarea , it should not accept the 5 th row & 11 th col...

Hw to create text area like that....
As others have said, textarea should not be limited, but in the real world,
where there are real bosses who think otherwise ....

There are some nice javascripts that deal with that, some even have a nice
little box that shows how many characters are left.

It is vital that you check the actual length server side. There is nothing
more disconcerting than "field would be truncated" (and of course it never
tells you WHICH field, but you already knew that).

--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

Jan 22 '07 #5

P: n/a
Sherm Pendley wrote:
Chris Beall <Ch*********@prodigy.netwrites:
>SSG wrote:
>>I have text area having 4 rows & 10 cols.. while I am typing in
Textarea , it should not accept the 5 th row & 11 th col...

Hw to create text area like that....
You could replace the textarea with <input type="text" size="40"
maxlength="40">. That will limit the input to 40 characters

"Limit" is too strong a word, I think. A cooperative browser will prevent
ordinary users from entering more than 40 characters. But, a hostile user
can easily use a noncooperative browser and/or a script to submit more data
than that to the server.

The internet being what it is, hostile users are in abundance, so depending
on the browser to enforce this so-called "limit" is a Very Bad Idea. By all
means, do include it - it's far more convenient for ordinary users to have
their browser limit their typing, than to submit the form and have an error
page come back. Just don't depend on it; double-check on the server to make
sure the browser did the right thing.

sherm--
SSG,

Sherm is absolutely correct. ANY data from a form should be validity
checked within the CGI code that processes the form. Checks should
include min-max length, code points used, value ranges, etc. The checks
should ensure that the CGI code itself will not fall apart, and should
further ensure that any downstream process (database, HTML written back
to the user) will not either fail or cause bad things to happen (such as
user input becoming executable JavaScript embedded in echoed HTML).

When processing user data, paranoia is essential.

Chris Beall
Jan 22 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.