in reply to Re: Re: HTML Problem getting entities into a textarea
in thread HTML Problem getting entities into a textarea

I want < to show up as-is, since that is what the user typed when the document was created.

If the user literaly typed '&' 'l' 't' ';', then to prevent this from being corrupted when you spit the text back out into a textarea, you're going to need to escape the '&'. This isn't an HTML bug, though it's not the most documented aspect of HTML that you'll find.

  • Comment on Re: Re: Re: HTML Problem getting entities into a textarea

Replies are listed 'Best First'.
Re: Re: Re: Re: HTML Problem getting entities into a textarea
by muad33b (Acolyte) on Apr 18, 2003 at 21:16 UTC

    Know what? This problem doesn't seem to exist here in perl monks. It's the same basic idea as here. Folks are entering html in textareas. But if I put this in

    <property key="smtpHost" value=""/>

    it is saved as I typed it - with the escapes, and viewed as I want it - escapes interpreted, and is brought back up in the edit textarea with the escapes intact; uninterpreted.

    What am I missing here? I need so save with all &s escaped to &amp;, and then unescape them to & when I display, but dump it when I edit, or vice versa?