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

Hi, I'm having trouble with this.

Status
Not open for further replies.

NeoTurtle

Programmer
Aug 25, 2000
38
US
Hi, I'm having trouble with this. I'm trying to replace carrige returns with <BR> and trying to ignore automatic linebreaks from the textarea. The following code is what was already done by someone before I started working here.

<%=replace(rs(&quot;content&quot;),chr(13) & chr(10), vbCrLf)%>

I tried just taking off the chr(10), assuming that was the automatic linefeed . . . didn't work. Anyone have any suggestions?
 
This is great, but one little problem. I don't want the linefeed to break the line. Basically, the textarea is smaller than the display area, which is just a cell in a table with a size of 100% width, so it ends up getting cut off. Is VbCrLf for just CRs or does it include things like automatic linebreaks in textareas (wordwrapping)?
 
Why do you want to insert <BR> if you don't want to break to the next line? I am guessing you just want to space out more from the text before hand? If that's the case then,
some times wordwrapping works on the web (for me), sometimes not. However I can get it to always work by inserting two non-breaking spaces for two space-bars rather than one for one, this way, at a one space break, it can word wrap...otherwise if the person wanted to set somthing out 10 spaces, they can still do it...Now, instead of space bars, you could just replace carriage returns with a non breaking space...and I don't think it would affect word wrapping, as you still have the inputs of space bars by the user...example:


<%
Dim string
string = Request.Form(&quot;myString&quot;)
string = Replace(string, vbCrLf, &quot; &quot;)

' The space there is supposed to be a &_nbsp;, but for some
' reason, it won't display the &_nbsp; (minus the underscore) 

Response.write(string)
%>


Hope this helps.
-Ovatvvon :-Q
 
<%=replace(rs(&quot;content&quot;),chr(13) & chr(10), vbCrLf)%>
chr(13) & chr(10) is the same as vbCrlf. What is the point? If you want to do as you said then
<%=replace(rs(&quot;content&quot;),vbCrLf,&quot;<BR>&quot;)%>
CrLf is carriage return line feed aka New Line.
 
vbCrLf is actually just a VBScript reference to chr(13)&chr(10). Word wrapping in the text field that you are replacing in is neither here nor there, as this does not get passed to the sumbit page. Basically all that gets returned is long strings, seperated by vbCrLf's. The replace statement above should work fine.

G -GTM Solutions, Home of USITE-
-=
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top