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

Update from form creates redundant CRLF's

Status
Not open for further replies.

achmo

Programmer
Aug 30, 2001
56
IL
Hello,

I'm using a form on my page to update information in my database. My problem is, every time I update, a CRLF is added to the end of each string originating from a textarea tag.

On a different page, I retrieve the information from the database and use an html table to present it. I use:

Code:
<%=replace(rs(&quot;ItemAbstract&quot;),chr(13) & chr(10), &quot;<br>&quot;)%>

to replace all the CRLF's to <br>, because sometimes I have more then one paragraph in a field and I want the new paragraph to start on a new line. The problem is, all those extra CRLF's at the end of the fields become <br>'s themselves, so I get a bunch of empty lines at the end of each cell.

Ideas, anyone?

Thanks, Yael
 
ok, I've found a way to work around the problem: I replace this string with &quot;&quot;:

Code:
 chr(32) & chr(32) & chr(32) & chr(13) & chr(10) & chr(9) & chr(32) & chr(32) & chr(32) & chr(13) & chr(10) & chr(9)

this string is basically two empty lines, so deleting it eliminates all those blank lines at the end, but keeps the *single* CRLF's between paragraphs.

But I still don't know why updating from textarea adds all this garbage to the end of the string.

Yael
 
Your textarea contains a crlf, in your submit do you have your texarea like this:
<textara>
</textara>(with crlf)
Or like this
<textara></textara>(empty textarea)

 
Oh my. This is *so* the source of the problem. Feel stupid now.

Thanks!

Yael
 
Made the same error on my page because I allways want HTML tags to look readable:

<tr>
<td>
<textarea>
</textarea>
</td>
</tr>

must be:

<tr>
<td>
<textarea></textarea>
</td>
</tr>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top