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

Web form that is parsed by ReadParse loses formatting

Status
Not open for further replies.

UnDoug

Programmer
Dec 11, 2002
14
US
Hello,

My first time posting here. If this isn't the appropriate forum area, please let me know.

I have a webpage that contains a fill-in form. One part of the form is a &quot;textarea&quot; using the <textarea> tags.

When I process the submitted data using &ReadParse in Perl 5.8.0, the carriage returns that a user may have entered are often screwed up.

For instance, if I were to type this message that I'm typing here in my form's textarea, when I then looked at the data that was submitted, it would all be joined as one paragraph instead of multiple paragraphs.

I've tried using a &quot;s/\n/<br>/g&quot; substitution, but that doesn't always work. That's another weird thing: in some situations, the formatting seems to be preserved, but not always.

Is there a simple way to retain the formatting of text that is input by a user?
 
not entirely sure, but try this
Code:
s/\r\n/<br>\n/g;
---
cheers!
san.
 
Thanks for responding! I think that may have solved the problem. Or at least in the testing I've done it seems to work. Thanks!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top