SitePoint Sponsor |
|
User Tag List
Results 1 to 2 of 2
Thread: Trouble with Input
-
Jul 9, 2008, 06:45 #1
- Join Date
- Mar 2008
- Posts
- 183
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Trouble with Input
Hey all,
Im having some trouble getting text to wrap when people are enterting text into a TextArea? Is it possible so that the text wraps as the type?Win A FREE iPhone!
Tired from working? Funny Things! Laugh the stress away
Some Funny Jokes | Funny Videos
-
Jul 9, 2008, 08:01 #2
- Join Date
- Sep 2004
- Location
- Toronto
- Posts
- 795
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Text should wrap by default when a textarea has a specified width (in html or in css ... preferably css).
Are you testing the text by just typing in a long line of characters? Then it will not wrap because the textarea has not been styled to break each line.
In IE there is a word-wrap:break-word; style which will do this. I'm not sure if firefox has something similar. So the only way to get around this is to have a server-side process which will add a newline character to words that extend say 30 characters.
Even sitepoint does it:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
You see the gap between the a characters.I can't believe I ate the whole thing
Bookmarks