Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Preserving 'Returns' in Message Area
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

SubKamran
Junior Member

101 Posts

Posted - 24 April 2002 :  13:09:49  Show Profile  Visit SubKamran's Homepage  Send SubKamran an AOL message  Send SubKamran a Yahoo! Message
I'm trying to make a site (with some other peeps) where people can submit articles. Now, I want to have the database preserve the hard returns, which i think it does. but, i need a script tha will display it exactly as the user typed it. Like forums such as Snitz. But, where can I find code. I tried using <Pre> but it won't wrap it...

What to do?

I'm using SQL...

Kamran A
14/m/mn
Minneapolis, MN
Web Dev/Flash Dev

@tomic
Senior Member

USA
1790 Posts

Posted - 24 April 2002 :  13:34:52  Show Profile  Visit @tomic's Homepage  Send @tomic an ICQ Message
Something like this will do it. Just put this at the top of the pge that displays articles or a page for editing articles.
'===========================================================	
Function showBreaks(str)
'===========================================================
showBreaks = replace(str, chr(10), " <br>")

End Function


And then where the text actually is show do this:

<%= showBreaks(rs.Fields("ArticleText").Value) %>

@tomic

http://www.skepticfriends.org

Edited by - @tomic on 24 April 2002 13:43:25
Go to Top of Page

SubKamran
Junior Member

101 Posts

Posted - 24 April 2002 :  16:20:47  Show Profile  Visit SubKamran's Homepage  Send SubKamran an AOL message  Send SubKamran a Yahoo! Message
O COOL! THANKS MAN!

Could I do the same with other commands such as 'Tabs'?

Kamran A
14/m/mn
Minneapolis, MN
Web Dev/Flash Dev
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 25 April 2002 :  12:33:04  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
yes you can use something like that with all the codes. you can look at the inc_functions.asp for some examples, but you may not just copy and paste the code unless you have the powered by snitz logo on your site.

Brad
Web Hosting with SQL Server @ $24.95 per month
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.32 seconds. Powered By: Snitz Forums 2000 Version 3.4.07