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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Textarea Formatting 1

Status
Not open for further replies.

kimble

Technical User
Aug 23, 2001
107
US
I have a cgi script that takes text from a textarea in a form and appends it to an html file to create a log file of entries. The problem I have is I lose any formatting put in place in the entry.

For instance If i entered the following into the textarea box:

1. Hello
2. World

I would get this posted to the page

1. Hello 2.World


How can I keep the formatting? Can I change something in the Textarea tag or do I have to edit the cgi-script?

Oh, I've also tried all the Wrap options of the tag and they do nothing.
 
You need to convert linefeeds to <br> tags to make it display properly, or enclose the whole thing in <pre> and </pre> tags to preserve the formatting. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
thanks...the <pre> tags worked!!

I had to place them in file that formats the output from the script. as such
<pre> <<textfromtextbox>> </pre>
 
Yup, that's exactly what I meant! It's interesting that, with all the fancy formatting people do on the web these days, it's sometimes easier to NOT do fancy formatting. Sometimes simplicity is best. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top