Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTML to text to HTML.......how to preserve formatting?

Status
Not open for further replies.

Webrookie

Programmer
May 18, 2000
112
US
On my website, I'm gonna have someone submit some text that they will type in.&nbsp;&nbsp;And it may or may not have carriage returns, line feeds, etc..<br><br>How do I preserve formatting?<br><br>When they submit, I will save what they type to a text file on the server.<br><br>When someone wants to view a saved file, I would like the textual appearance as it was typed in to be preserved.<br><br>Any ideas?
 
Do you have any database to store the data? then simply store all the matter in database column.<br><br>You can use Access database. it is small, easy database.<br><br>it will work.<br><br>Anand Mishra
 
Actually, I solved it...kinda.&nbsp;&nbsp;When they sumbit a textarea with text in it, I save what they wrote to a text file...and, through IE at least, if you link to that file on the server, it opens up just fine, formatting preserved.<br><br>I was gonna do an access database, but I already have a couple of those and I didn't want to do another.<br><br>thanks anyway...
 
if through the process of outputs in ASP, I always use vbtab and vbcrlf, in my codding, even tho it makes no difference HTML wise, I can look at its source and it'll be nicely formated kind of like doing this<br><br><FONT FACE=monospace><br>Response.write &quot;&lt;Table&gt;&quot; & vbcrlf<br>Response.write vbtab & &quot;&lt;TR&gt;&quot; & vbcrlf<br>Response.write vbtab & vbtab & &quot;&lt;TD&gt; yo &lt;/TD&gt;&quot; & vbcrlf<br>Response.write vbtab & &quot;&lt;/TR&gt;&quot; & vbcrlf<br>Response.write &quot;&lt;/Table&gt;&quot; & vbcrlf<br></font><br><i>you could throw it on all one line, but wouldnt look good in ASP code</i><br><br>what you get when you view the source(text) is this<br><br><FONT FACE=monospace><br>&lt;Table&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;TR&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;TD&gt; yo &lt;/TD&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/TR&gt;<br>&lt;/Table&gt;<br></font><br><br>instead of this<br><FONT FACE=monospace><br>&lt;Table&gt;&lt;TR&gt;&lt;TD&gt; yo &lt;/TD&gt;&lt;/TR&gt;&lt;/Table&gt;<br></font> <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top