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 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jul 2002
    Location
    The sunny side of the Alps
    Posts
    230
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Substitute for vbCrLf - urgent

    Hi!

    I have information about our clients stored in different fields in the database (name, surname,...). Whe a person comes to a page with specific ID of a person in the QueryString, I need to show all information about that person in ONE TEXT AREA field. The problem is that I do not know how to format the text in the filed, so that information would be shown in seperate lines:

    name surname
    street
    city
    ...

    instead of
    name surname street city ...


    In VB I use 'vbCrLf' to to that. What can I use in ASP?


    Thanks,
    Bostjan

  • #2
    Registered User
    Join Date
    Jun 2002
    Location
    Arizona
    Posts
    175
    Thanks
    0
    Thanked 0 Times in 0 Posts
    function cleanString(string_clean)
    string_clean = Trim(string_clean) ' cleans out white spaces
    string_clean = Server.HTMLEncode(string_clean) ' cleans out html tags
    string_clean = Replace(string_clean, chr(13), "<br />") ' REPLACES ALL RETURNS IN A TEXT FIELD WITH <br />
    cleanString = string_clean
    End Function

    thisStr = cleanString("thisStr")

    i hope this helps

  • #3
    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
    vbCrLf works just fine with ASP/VBScript:

    Code:
    <form>
    <textarea name="test"><% = "Line 1" & vbCrLf & "Line 2" & vbCrLf %></textarea>
    </form>
    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
    •