Setting TextArea Value From Database Data

Results 1 to 2 of 2

Thread: Setting TextArea Value From Database Data

  1. #1
    Join Date
    Dec 1969

    Default Setting TextArea Value From Database Data

    I am having trouble with forms in ASP. The site I am currently developing allows the user to input content into a form, which is then stored in a database Memo field (replacing every &#039vbNewLine&#039 with a &#039BR&#039 tag). The problem comes when the user comes back to the page and I want it to display the stored content for editing. I have written shared scripts to retrieve the content and replace the BR&#039s with vbNewLine&#039s. How do I take these and put the result into the TextArea? It seems that it should be simple.<BR><BR>Thanks in advance,<BR><BR>Chris

  2. #2
    Yngvar Guest

    Default RE: Setting TextArea Value From Database Data

    I have had the same problem, and solved it like this. When I store the value from the textarea field in a memo field in a database I didn&#039t do anything with it, but when I&#039m displaying it I do it like this.<BR><BR>To display it inside a textarea tag don&#039t do anything with it, the textare box understands the "linefeeds"<BR><BR>When you want to display as "normal" text do like this<BR><BR>&#060;%<BR>Text = Text form memofield in a database<BR>Text = Replace(Text,vbCrlf,"<BR>")<BR>Response.Write Text %&#062;<BR><BR><BR>This should display the text the way you want it to<BR>

Posting Permissions

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