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

Thread: textarea

  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    England, Hythe
    Posts
    207
    Thanks
    0
    Thanked 0 Times in 0 Posts

    textarea

    how can i keep the fomating of a textarea so if they drop a line in the textarea i need to to remeber that but its needs to go in to a database as well so can i still keep the formating throught a database

  • #2
    Regular Coder
    Join Date
    Jan 2003
    Posts
    867
    Thanks
    4
    Thanked 8 Times in 8 Posts
    When you are displaying the data from the table, print it like this:

    Code:
    response.write replace(RS("field_descripton"), vbcrlf, "<br>")
    I guess you could replace the vbcrlf with "<br>" before you insert it into your database and then response.write it out normally, but I don't know if that will cause other problems.

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    England, Hythe
    Posts
    207
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks for the help

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    41 8' 52" N -95 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Your database will store line breaks. No worries there.

    Function VbCrLfToBreak(byVal str)
    If IsNull(str) Then str = ""
    VbCrLfToBreak = Replace(str,vbCrLf,"<br />")
    End Function
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)


  •  

    Posting Permissions

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