SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist jimday1982's Avatar
    Join Date
    Sep 2002
    Location
    Atlanta, GA
    Posts
    562
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help with line breaks inside a URL

    On my first page, I have a typical form with a text area where the user can enter text, press submit, and have the results displayed on the second page.

    My issue is that the second page is not displaying line breaks if the user hits "return" when typing text in the text area. I noticed in the URL of the second page, a line break is interpreted as "%0D%0A%0D%0A", but even when testing for that string and replacing it with line breaks, the text continues to run together.

    Does anyone know of a way to pick up these line breaks in the URL and output them on the page? Any info is greatly appreciated.
    Jimmy Day
    Senior Systems Analyst
    Piedmont Healthcare Corporation

  2. #2
    SitePoint Enthusiast
    Join Date
    Apr 2007
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This should be your solution Jim.

    http://jennifermadden.com/javascript/stringEscape.html

  3. #3
    SitePoint Evangelist jimday1982's Avatar
    Join Date
    Sep 2002
    Location
    Atlanta, GA
    Posts
    562
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Developer1983 View Post
    Awesome! This worked beautifully! Thanks so much.
    Jimmy Day
    Senior Systems Analyst
    Piedmont Healthcare Corporation


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
  •