SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    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

  2. #2
    $books++ == true matsko's Avatar
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •