Formatting text from database

Results 1 to 2 of 2

Thread: Formatting text from database

  1. #1
    Hameed Bhatti Guest

    Default Formatting text from database

    I have a textarea field on a form (as shown below)<BR><BR>&#060;textarea name="newsletter" class="input_box" COLS="95" ROWS="15" wrap="virtual"&#062;&#060;/textarea&#062;<BR><BR>that is fairly big and when this form is submitted, the text initially would have carraige returns in it (as it would have a few paragraphs of text) as the writer is posting an article. When I collect the info from the form I am simply doing a request.form ("newsletter") . I then do an insert into a table in SQL server and then somewhere else on the site I display this record. The problem with this display is that the carraige returns are no longer in the text and it just gets this long text - see this here . <BR>My question is, what character am I looking for when I do my response.write so that I can replace it with a br tag so that the text gets formatted correctly?<BR>This is just like this online form for submitting questions.<BR><BR>Please Help. !!<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Formatting text from database

    &#060;PRE&#062;&#060;%=rSelect("NewsText")%&#062;& #060;/PRE&#062; would work. You can specify &#060;FONT&#062; parameters so it won&#039;t wind up as Courier.<BR><BR>or<BR><BR>&#060;%=replace(rSelect( "NewsText"),vbcrlf,"&#060;P&#062;"%&#062; changes the carriage return/linefeed combination to a paragraph break. Have not tried this one so I don&#039;t know.

Posting Permissions

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