0

I have this textbox in my webapp for help desk software and I want the user to be able to put HTML code in it and it still show as the code. Currently it renders the object that it specifies when you review the saved HTML code on another day. I want it so when it is pulled from the database and shown on the page - it will show the actual code, not render it. Remember the text will always be different (because a user types it in as a ticket note) and renders later. So what would I put in this html to prevent that:

<tr>
    <td valign=top>
    Note:   
    </td>
    <td colspan=2>
    <%=rstTicket("ticketnote")%>
    </td>
</tr>
djblois
  • 963
  • 1
  • 17
  • 52
  • The HTML you are inserting (dynamically I assume) is being rendered inside the textarea? That should not be the case. In fact there is another question posted of the exact opposite of this: http://stackoverflow.com/questions/19441026/show-html-output-in-textarea-instead-of-html-code – bfritz Jan 21 '15 at 20:56
  • No it is a intranet help desk software that my company has created and uses. So if someone enters a ticket with HTML code in it - it saves it in the database. Then when Someone views the notes for that ticket it renders the code instead of showing the actual HTML code. I want it to show the code itself. – djblois Jan 29 '15 at 19:18

1 Answers1

0

Try adding your variable in to a jQuery text() call - $("#textHTML").text(textHTML); and then displaying it in a textbox. I am doing a similar thing with at a site where I can show the raw HTML but doing this through a call in Mustache.

Jeff
  • 283
  • 1
  • 8