SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot cachobong's Avatar
    Join Date
    Jan 2005
    Location
    cebu
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    trimming whitespaces from a text area

    hi,

    i want to trim a white space caused by pressing enter in a textarea. coz if i just press enter in a text area, i wont recognize that there is no value in it.

    How do i do that?

  2. #2
    SitePoint Wizard
    Join Date
    Mar 2004
    Posts
    1,647
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what you want to do with that data from textarea?

  3. #3
    SitePoint Enthusiast johnmanoahs's Avatar
    Join Date
    Jul 2004
    Location
    India
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by cachobong
    hi,

    i want to trim a white space caused by pressing enter in a textarea. coz if i just press enter in a text area, i wont recognize that there is no value in it.

    How do i do that?

    Code:
    document.getElementById(textbox_ID).value.replace("\r","  ")
    - John
    If you think you are too small to make an
    influence, try sleeping with a mosquito in a closed room.


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
  •