help w/ text format in asp

Results 1 to 4 of 4

Thread: help w/ text format in asp

  1. #1
    johnw Guest

    Default help w/ text format in asp

    Any one know how I can keep the text format (carage returns) from a text box. I am putting it into a database and when I output the record from the data base I get one long line.

  2. #2
    DaveL Guest

    Default RE: help w/ text format in asp

    Do you mean *textarea* rather than *textbox*??<BR><BR>Here&#039s some code that works for me.<BR><BR>dim strText<BR>strText=request.form("textarea_name")<B R><BR> if instr(strText,(chr(10)&chr(13)&chr(10)))then<BR> strText=replace(strText,(chr(10)&chr(13)&chr(10)), "&#060;p&#062;")<BR> end if<BR> if instr(strText,chr(10)) then<BR> strText=replace(strText,chr(10),"<BR>")<BR> end if<BR><BR>Haven&#039t quite worked out why you need to repeat the *chr(10)* in the first two lines, but if it works I don&#039t try to fix it. :o)<BR>

  3. #3
    johnw Guest

    Default Thanks but it didn't work

    Thank for the code but it doesn&#039t do the trick. I&#039m sending form data to sql and then using ado to spit it back out on an asp page. Any other ideas?

  4. #4
    Drydenmaker (@hotmail) Guest

    Default RE: Thanks but it didn't work

    Try somthing like this:<BR><BR>String = Replace(String,chr(13), "")<BR>String = Replace(String,chr(10), "")<BR><BR>It is much simpler, the reason for this is when you hit "Enter" it sends a EOL and a Carage return.

Posting Permissions

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