This may not really be a jQuery question; if you can suggest someplace better to ask, please let me know.

I have some HTML in a textarea that the user will need to be able to edit (eventually in FCK Editor.) This is stored in a DB as HTML, with some things that look like escaped XML start tags included, e.g.

    <p>Some text, including a &lt;CustId&gt; in the middle.</p>

I would like the editor to use the regular markup such as "<p>" as editing marks, but to treat the escaped code such as "&lt;CustId&gt;" as plain data. The trouble is, any way I've found to pull the code from the textarea treats them the same, either both as markup or both as escaped data. It seems as though loading the textarea into the DOM is masking the difference.

Is there a straightforward way to retrieve the markup from a textarea that retrieves it looking just as it does in the source code view?

If you look at this page:

    http://scott.sauyet.com/issues/2008-07-20a/

and check the Firefox console, you'll see that none of these works the way I'm hoping:

    $textarea.text()
    $textarea.html()
    $textarea[0].innerHTML
    $textarea[0].value
    document.getElementById("test").value
    document.getElementById("test").innerHTML

Does anyone have a suggestion as to how I can get back the original source version of this?

  -- Scott

where

Reply via email to