473,769 Members | 2,372 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1978

"yawnmoth" <te*******@yaho o.com> schreef in bericht
news:11******** **************@ f14g2000cwb.goo glegroups.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*******@yaho o.com> schreef in bericht
news:11******** **************@ f14g2000cwb.goo glegroups.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
2583
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 width of any sized screen". Sorry but I cannot fathom how to do this! <textarea name="resume" cols="108" rows="29" wrap="physical><?= $resume ?></textarea>
2
11236
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(); var safari = ((agt.indexOf('safari') != -1) && (agt.indexOf('mac') != -1))? true:false; var opera = (window.opera)? true:false;
3
6774
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 (https://bugzilla.mozilla.org/show_bug.cgi?id=302710), FireFox does not listen to the textarea.wrap = 'soft' command. Because I want the script to be cross-browser compatible, someone suggested to remove and immediately add a node to the DOM, so I now have: ...
3
5109
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" runat="server" Width="100%" Height="226px" TextMode="MultiLine"> For IE it renders <textarea name="tbxNote" id="tbxNote" style="height:226px;width:100%;">
4
8026
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 here: http://www.publicdomainsoftware.org/ajaxExperiment.htm Click in any box to get the controls with which you can play around. This function below, askForInput, was working the way I wanted, till I tried to give it two parameters, one...
8
53023
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 Mark
8
5563
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 should work, too. Or is my only solution to loop through each one and use ..addEventListener? And then trap for any DOM modifiactions in case new ones are created. Thanks,
4
7806
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 find the text and select it using the function below, BUT I can't figure out how to have the textarea automatically scroll to the selection in Firefox. Any ideas or suggestions? function search(needle,haystack,start) { var element =...
2
6534
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 firefox creates an elastic band effect. The textarea quickly scrolls down then bounces up to the top, no matter what I try. Has anyone run into the same difficulty? How did you solve it?
0
9416
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10199
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10035
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9981
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9850
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8862
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6662
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3948
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3551
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.