Forums
This topic is locked
Preserve Spaces
Posted 23 Jan 2003 11:21:06
1
has voted
23 Jan 2003 11:21:06 Guenther Kraibacher posted:
Hello!How to preserve spaces of text that is stored in a record from a text area?
Thanks in advace
Guenther
Replies
Replied 23 Jan 2003 12:47:50
23 Jan 2003 12:47:50 Tony Chronopoulos replied:
I'm not quite sure what exactly you're asking. Spaces are preserved automatically in strings.
Post some of your code or try being a little more specific! <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Hello!
How to preserve spaces of text that is stored in a record from a text area?
Thanks in advace
Guenther
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
___________________
microdesign² | www.microdesign2.com
Post some of your code or try being a little more specific! <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Hello!
How to preserve spaces of text that is stored in a record from a text area?
Thanks in advace
Guenther
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
___________________
microdesign² | www.microdesign2.com
Replied 23 Jan 2003 13:46:32
23 Jan 2003 13:46:32 asp asp replied:
put this above the <html>
<SCRIPT RUNAT=SERVER LANGUAGE=VBSCRIPT>
function PreserveWhitespace(str)
tabStr = chr(160)&chr(160)&chr(160)&chr(160)&chr(160)
str = Replace(str,chr(10),chr(10)&"<BR>"
str = Replace(str,chr(9),tabStr)
PreserveWhitespace = str
End Function
</SCRIPT>
and then when displaying your recordset in the body use this
<%= PreserveWhitespace((Recordset1.Fields.Item("whatever_table".Value)) %>
thats it
<SCRIPT RUNAT=SERVER LANGUAGE=VBSCRIPT>
function PreserveWhitespace(str)
tabStr = chr(160)&chr(160)&chr(160)&chr(160)&chr(160)
str = Replace(str,chr(10),chr(10)&"<BR>"
str = Replace(str,chr(9),tabStr)
PreserveWhitespace = str
End Function
</SCRIPT>
and then when displaying your recordset in the body use this
<%= PreserveWhitespace((Recordset1.Fields.Item("whatever_table".Value)) %>
thats it