PDA

View Full Version : Substitute for vbCrLf - urgent



bostjank
08-18-2002, 03:26 PM
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
:thumbsup:

Phip
08-18-2002, 07:24 PM
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

whammy
08-19-2002, 01:10 AM
vbCrLf works just fine with ASP/VBScript:



<form>
<textarea name="test"><% = "Line 1" & vbCrLf & "Line 2" & vbCrLf %></textarea>
</form>