SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jul 2004
    Location
    toronto
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Rich Text Editors and carriage returns (?)

    I'm using a Rich Text Editor (RTE) in a form. I send the HTML to another page for user verification with a back button and a submit button.

    As an example, let's say I have the following in my RTE field:

    First line of text here.

    Second line of text here.

    The above text will be passed to the verification page as:

    <P>First line of text here.</P>
    <P>Second line of text here.</P>

    This is all good, but if I want to pass the HTML back to the form and edit it, I get an "Unterminated String Constant" error and the RTE field won't display. Now, I think this is happening because the HTML being passed back into the RTE is not all on one line.

    So what I want (if possible) is to pass back:

    <P>First line of text here.</P><P>Second line of text here.</P>

    instead of:

    <P>First line of text here.</P>
    <P>Second line of text here.</P>

    I'm not sure how to rectify this. I've tried replacing CHR(13), but that hasn't helped. I'm not sure if there is some invisible character there and how I would find out what it is. Outputting the variable, view source and copying and pasting into another text editor won't show me anything. But it was worth a shot.

    I have no problems passing the HTML around to other pages or saving it to a SQL database. It's just when I have to send the HTML back to the editor with paragraph or list tags that I encounter this problem.

    Thanks,
    AA

  2. #2
    SitePoint Enthusiast
    Join Date
    Oct 2006
    Posts
    66
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    CHR(10) i think might be that hidden character you are trying to replace.

    maybe you need to escape the <p> tag to be like &lt;p&gt; so that it displays it properly


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
  •