As you can tell from the title this is actually more of an HTML question. I have a perl cgi script for a knowledge base that allows folks to add technotes as html. Everything works fine, except html escapes in textareas. For example:
If a user is adding a technote that refers to xml edits, and they want to escape the < by using "<" then the file gets posted and saved fine by my script. But when the user comes back to edit the document again, and I spit it out between the textarea tags - it stays that way in the html source, but in the textarea the < gets traslated to < and when it is saved, the xml tags that were in the technote to be modifed as text are now interpreted as html/xml tags and not text to be displayed in the textarea.
Funny enough the <pre> <code> tags dont help - they aren't interprested as tags, but rather displayed.
Does anyone know a way around this? or are textareas just crappy for editing html? Maybe some type of javascript?
Here is some example code - I've escaped the < and > so that it will show ok in here:
<textarea><property key="smtpHost" value=""/></textarea>
Just drop this in an html doc, and you will see that the escapes will show as <> and not < and > in the textarea
I'll probobly get bashed since the answer has little to do with perl, but I figured if anyone might know, it'd be the Perl Monks
TIA, Jeff
In reply to HTML Problem getting entities into a textarea by muad33b
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |