Forum Moderators: coopster & phranque

Message Too Old, No Replies

preserve carriage returns

         

shakes911

1:20 pm on Mar 30, 2001 (gmt 0)



is there any way of accepting text from a textarea in a form and preserving the carriage returns within that text? I've tried using vbcr but it doesn't seem to do the job.

cheers

Xoc

2:33 pm on Mar 30, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There is an attribute to textarea for IE that tells it to preserve carriage returns. Unfortunately, it is an IE extension so it doesn't work in Netscape or Opera. See [msdn.microsoft.com...]

Brett_Tabke

7:05 pm on Mar 30, 2001 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Well,
as
you
can
see

we are preserving carriage returns here.

So, I'm not sure of the question. You shouldn't have to do anything to preserve cr's. Cr's are removed in the post processing.

What am I missing here?

tedster

8:08 pm on Mar 30, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This came up on an older thread, but it was never resolved. It looks like this area of how to preserve or drop carriage returns is a side skirmish in the browser wars, started back when Netscape was dominant.

I read on idocs.com [idocs.com] that Virtual and Physical were Netscape's proposed values for HTML 3.0. Soft and Hard, respectively were the MSIE proposal.

Then I read on Webreference.com [webreference.com] that Netscape now supports only hard¦soft and MSIE supports physical¦virtual. That's a weird reversal!

I've also read that recent browsers only support the hard¦soft values. I haven't found a W3C recommendation, but I'll bet I've missed it. HTML 3.0 was a long time ago for the issue to remain unresolved.

I can't say I've tested any of this, though. By trying to research it I only ended up more confused.

Brett_Tabke

9:11 pm on Mar 30, 2001 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Virtual is what I'm using here.

shakes911

8:52 am on Apr 2, 2001 (gmt 0)



The problem is that I'm accepting text from a form and storing it in a file using ASP. When I retrieve the text from the file the carriage returns are no longer there. Any help with a remedy would be greatly appreciated.

shakes911

12:42 pm on Apr 2, 2001 (gmt 0)



A solution has been found.

I've just done a replace which detects chr(13) and replaces it with a <P>.

Thanks fellas

Brett_Tabke

2:12 pm on Apr 2, 2001 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



That is just what we do here Shakes. Double returns (\n\n) transpose into <p> tags and then singles (\n) go to <br>'s.