Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jul 2004
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ASP FORM, Text Formatting.

    Hello, I have a ASP form that has a text box. I type something in it and create Formatting and submit the results to my MSSQL database.

    When I pull the results using a ASP form, The Text box looses its formatting.

    Example:

    Text Box Entry:
    - TEST TEXT
    - TEST TEXT
    - TEXT TEXT

    When I view it using a ASP form, It populates the text box like this:
    - TEST TEXT - TEST TEXT - TEXT TEXT

    QUESTION: How can I tell the Form/Database to retain the formatting using ASP?

    Thank you to anybody who can help.
    Chris@thesouthside.net

    Chris

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,037
    Thanks
    0
    Thanked 250 Times in 246 Posts
    Put the content inside <pre> </pre> tags

    <pre>
    <%=rs("theField")%>
    </pre>

  • #3
    New Coder
    Join Date
    Jul 2004
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It works!

    Thanks!

    Chris

  • #4
    Regular Coder
    Join Date
    Aug 2002
    Location
    USA
    Posts
    478
    Thanks
    0
    Thanked 2 Times in 2 Posts
    And at least for Access databases this can work:

    ' Convert all vbCrLf to <br>.
    ' (This is the same as converting Chr(13) & Chr(10) to <br>.)
    theFld = Replace(theFld, vbCrLf, "<br>")
    J. Paul Schmidt
    www.Bullschmidt.com - Freelance Web and Database Developer
    www.Bullschmidt.com/DevTip.asp - Classic ASP Design Tips


  •  

    Posting Permissions

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