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