473,395 Members | 1,968 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,395 software developers and data experts.

fixing stretching textarea's in firefox

in firefox, long strings without spaces cause a horozontal scrollbar to
appear at the bottom of any given textarea. for example, if your
textarea supports 50 characters, and 100 consecutive non-space
characters are entered, stretching will occur. is there a fix for
this, using javascript?

Jul 23 '05 #1
3 1939

"yawnmoth" <te*******@yahoo.com> schreef in bericht
news:11**********************@f14g2000cwb.googlegr oups.com...
in firefox, long strings without spaces cause a horozontal scrollbar to
appear at the bottom of any given textarea. for example, if your
textarea supports 50 characters, and 100 consecutive non-space
characters are entered, stretching will occur. is there a fix for
this, using javascript?


Who is gonna type a 50 character word?

grt Bert
Jul 23 '05 #2
yawnmoth wrote:
in firefox, long strings without spaces cause a horozontal scrollbar to
appear at the bottom of any given textarea. for example, if your
textarea supports 50 characters, and 100 consecutive non-space
characters are entered, stretching will occur. is there a fix for
this, using javascript?


You need to define what a 'fix' is. Do you mean prevent the
scroll bars from showing so that the extra characters are
present but not displayed, or do you mean some form of wrapping
of the line of text?

If the intention is to wrap the text, please explain the logic
to be used to insert characters to break the line:

1. What character should be used to break the string: return,
newline or space?

2. Should the new character simply be inserted at char 50 or
should some other logic apply? e.g. if there is a space
within the last 50 characters, don't insert a break,
otherwise do.

3. If a break is inserted and the user types say 120 characters,
how does the script determine where to put breaks? Does it
just remove all breaks and insert new ones at 50 character
intervals?

4. As above, but the user has pasted text into the text area.

5. What to do if the user inserts say 40 characters, then goes
back to the start and inserts 30 more characters - then
deletes 20. How does the script know that it inserted a
break, and where is the script-inserted break now, were
characters deleted before or after it?

6. /Et cetera/.

Perhaps a scroll bar is a good idea after all...

--
Rob
Jul 23 '05 #3

Bert wrote:
"yawnmoth" <te*******@yahoo.com> schreef in bericht
news:11**********************@f14g2000cwb.googlegr oups.com...
<snip>

Who is gonna type a 50 character word?


someone pasting a url into a textarea with more than 50 consecutive
non-space characters? url's from google groups, as an example, are
easily more than 50 consecutive non-space characters long.

Jul 23 '05 #4

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

Similar topics

12
by: Phil Powell | last post by:
The customer made a wild request: they want on their admin panel a textarea that will display an existing resume. This textarea, however, must have a dynamic width, one that "fills the screen...
2
by: Mark Szlazak | last post by:
The following code fails in Firefox to get at selected text in the right-side textarea. Any help would be appreciated. <html> <head> <script> var agt = navigator.userAgent.toLowerCase();...
3
by: Fluffy Convict | last post by:
I am trying to write a script that changes a textarea wrap realtime, basically like you can switch to and from "wordwrap" in Microsofts Notepad. Because of a bug...
3
by: honcho | last post by:
Hello: When my web application is invoked by Firefox the height and width information is passed to Internet Explorer but not to Firefox. The ASP.NET control is <asp:textbox id="tbxNote"...
4
by: Jake Barnes | last post by:
I wanted to teach myself AJAX this weekend so I sat down with Stuart Landgridge's book and I started to play around. I came up with a little page that you can add text and images to. You can see it...
8
by: Mark D. Smith | last post by:
Hi I have googled but not found a solution to wordwrap in a textarea using firefox/netscape. is there a style sheet solution or am i stuck with not being able to force wrapping in a textarea...
8
by: Csaba Gabor | last post by:
Is there any way in Mozilla/Firefox to add an event listener to all textarea elements? Something along the lines of HTMLTextAreaElement.prototype.onkeydown = function() {alert('mom');} only it...
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...
2
by: rjonasz | last post by:
Hey Everyone, I'm trying to scroll a textarea to the position of the caret which is below the visible area of the textarea in firefox. I have code which works in IE but the code I use for...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.