displaying HTML tags in a text area

Results 1 to 3 of 3

Thread: displaying HTML tags in a text area

  1. #1
    Join Date
    Dec 1969

    Default displaying HTML tags in a text area

    Dear All,<BR><BR>I have a problem. I am retreiving data from an Access database and then display it in a text box. However, where there are HTML tags in the field, it is not displaying them properly. For exemple &#060;b&#062;Johann&#060;/b&#062; is not displayed in bold but as it is coded, ie "&#060;b&#062;Johann&#060;/b&#062;". This problem only seems to occur in text area boxes, cause when I display them normally, ie <BR>&#060;%=(rs.Fields.Item("ItemText").Value)%&#0 62;, it is displayed properly. How can I solve this problem?<BR><BR>Another thing, I used text area boxes so that I can display a scrollbar with the field, so that the user can scroll the information.<BR><BR>Thanks for your help

  2. #2
    Join Date
    Dec 1969

    Default Server.HTMLEncode()

    simply put.

  3. #3
    Join Date
    Dec 1969

    Default RE: displaying HTML tags in a text area

    Are you trying to display the text in or display the actual HTML code? if you want the display to look like "&#060;b&#062;Johann&#060;/b&#062;" the use server.HTMLEncode(). If you just want the word "johann" displayed in bold then you can&#039;t. The text in a textbox can&#039;t be formatted like that. You have got some control through stylesheets tho. <BR><BR>My solution would be to create an element class called &#039;mytext&#039; or something, and display the text in this element. you can do this by accessing the elements &#039;.innerHTML property&#039;. This element can also be given scrollbars, and if you were really diligent, you could make it look exactly like a textbox. check out some css.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts