473,387 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Anyone know how to make an unscrollable TEXTAREA?

Does anyone know a clean method of preventing scrolling altogether in a
TEXTAREA
(i.e. ensuring the user CANNOT type more text than fits inside the box
area)?

I'd like to know how, if so... It seems there should be a way to do it, but
I don't know of any, except via an awful javascript kludge.

Note: I am using a TEXTAREA with a proportional font and a size set in
pixels/ems via inline STYLE attribute.
I DON'T want to limit the number of characters, I just want to ensure that
the text can fit within the prescribed area
(so that when the inputted text is later re-displayed on a web page, it fits
in the allocated spot).
-- Dean Trower

please reply to: dean [at] omnivision [a dash goes here; yes, a DASH, not a
dot!] au [now, a dot] com
Oct 8 '05 #1
7 4546
Dean Trower wrote:
Does anyone know a clean method of preventing scrolling altogether in a
TEXTAREA
(i.e. ensuring the user CANNOT type more text than fits inside the box
area)?
No, not with HTML.
If you want to control the amount of text:
1. Truncate the input
2. Use one or more <input type="text" ...> boxes
I DON'T want to limit the number of characters, I just want to ensure that
the text can fit within the prescribed area

You don't want to limit the number of characters but you want to limit
the amount of text. Hmm.

(By "dash" I presume you mean a hyphen?)

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Oct 8 '05 #2
Dean Trower wrote:

Note: I am using a TEXTAREA with a proportional font and a size set in
pixels/ems via inline STYLE attribute.
I DON'T want to limit the number of characters, I just want to ensure that
the text can fit within the prescribed area
(so that when the inputted text is later re-displayed on a web page, it
fits in the allocated spot).


This kind of 'pixel perfect WYSIWYG' won't work anyway - you don't know, if
a visitor has your prefered font installed or overrides your styles with
his/her own rules - probably a simple 'ctrl-+' will already break your
layout.
Instead of requiring unreasonable constraits on the text, make the layout
flexible enough to work with any text length and font size.
Constraits on the number of characters (e.g. 'the text excerpt should be
400..500 characters long') are valid and often used in content management
system. But these have nothing to do with layout and should not be abused
for it.

--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
Oct 8 '05 #3
AES
In article <di**********@online.de>, Benjamin Niemann <pi**@odahoda.de>
wrote:
Dean Trower wrote:

Note: I am using a TEXTAREA with a proportional font and a size set in
pixels/ems via inline STYLE attribute.
I DON'T want to limit the number of characters, I just want to ensure that
the text can fit within the prescribed area
(so that when the inputted text is later re-displayed on a web page, it
fits in the allocated spot).


This kind of 'pixel perfect WYSIWYG' won't work anyway - you don't know, if
a visitor has your prefered font installed or overrides your styles with
his/her own rules - probably a simple 'ctrl-+' will already break your
layout.
Instead of requiring unreasonable constraits on the text, make the layout
flexible enough to work with any text length and font size.
Constraits on the number of characters (e.g. 'the text excerpt should be
400..500 characters long') are valid and often used in content management
system. But these have nothing to do with layout and should not be abused
for it.


Seems to me I've encountered text entry fields in web pages where the
field simply won't accept any more characters (or keystrokes) beyond
some (unstated) number, whether or not the field is visibly full. You
can however back up, delete, and reenter, up to the same total. No idea
how this is done, but seems to me I've encountered it more than once.
Oct 8 '05 #4
Dean Trower a écrit :
Does anyone know a clean method of preventing scrolling altogether in a
TEXTAREA
(i.e. ensuring the user CANNOT type more text than fits inside the box
area)?

I'd like to know how, if so... It seems there should be a way to do it, but
I don't know of any, except via an awful javascript kludge.

Note: I am using a TEXTAREA with a proportional font and a size set in
pixels/ems via inline STYLE attribute.
This looks like rigid, overconstraining accurate-pixel design so far.
I DON'T want to limit the number of characters, I just want to ensure that
the text can fit within the prescribed area


You are asking for something contradictory here. What is exactly
supposed to constrained:
- the size of the textarea? You say you want to prevent scrolling of the
textarea box
- the number of characters: you say you don't want to limit the number
of characters.

Just try yourself in any editing environment. Type as much as you want
into a fixed size container.

Gérard
--
remove blah to email me
Oct 9 '05 #5
AES wrote:

Seems to me I've encountered text entry fields in web pages where the
field simply won't accept any more characters (or keystrokes) beyond
some (unstated) number, whether or not the field is visibly full.

Javascript.

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Oct 9 '05 #6
Jim Moe <jm***************@sohnen-moe.com> writes:
AES wrote:
Seems to me I've encountered text entry fields in web pages where
the field simply won't accept any more characters (or keystrokes)
beyond some (unstated) number, whether or not the field is visibly
full.

Javascript.


Or the advisory maxlength attribute, where the browser supports it.

--
Chris
Oct 10 '05 #7
Chris Morris wrote:
Jim Moe <jm***************@sohnen-moe.com> writes:
AES wrote:
Seems to me I've encountered text entry fields in web pages where
the field simply won't accept any more characters (or keystrokes)
beyond some (unstated) number, whether or not the field is visibly
full.


Javascript.


Or the advisory maxlength attribute, where the browser supports it.


The TEXTAREA element doesn't have a maxlength attribute.
Oct 10 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Csaba Gabor | last post by:
What I'd like to do is to be able to set the font of a textarea element to the same font that another element is using (say, for example, an <INPUT type=text ...> element, but if that's a no go,...
1
by: Volt | last post by:
is there any way to select and mark part of text in textarea by regular expression? i need to select the first string in textarea whitch is like xxxxx,xxx where x is any character
4
by: TJS | last post by:
can the rows and columns of a textarea element with an id be changed on the fly ? if so is there an example ?
9
by: Neo Geshel | last post by:
I have strip-mined, strip-searched, and completely exhausted the Internet (up to the 30th page on Google, with 100 results per page!!), all without finding an answer to my question AS TO WHY IT...
8
by: firewood | last post by:
I am developing a form-based website development system using PHP5, and I want to incorporate a secure, reliable, Wysiwyg textarea script in place of the standard, unformatable, text-only textarea...
0
by: schapopa | last post by:
Hi, I would like to make first column unscrollable in my data grid. I have a class to change the color of that column. Is it possible now to make it unscrolable? Thank you Schapopa
4
by: Keith Bentrup | last post by:
Hi all, I wrote a simple search function to find text in a textarea where not all the text is visible (ie. the text box displays 10 lines but there may be more than 1000 lines to search). I can...
1
by: den | last post by:
<textarea name="vtext" id="vtext"> ........ <img width="10" height="20" src="http://sito/14.jpg" /> </textarea> with del I can delete image, how I can know when by keyboard delete the image?
0
by: idorjee | last post by:
hi, i'm trying to get the input from the html textarea into a file or a variable, so that i could than execute with a perl script that i've written. I thought using HTML::Form module would do the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.