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!

Formatting Dynamic Text 1

Status
Not open for further replies.

dongledell

Technical User
Dec 10, 2002
26
GB
Having a minor problem with the displaying of text pulled from a database.

In the db it has carriage returns in so that it is in a certain structure (numerically highlighted, i.e
1: do this
2: do that
etc)
only when it gets pulled into the page, it ends up as
1: do this2: do that3: etc

any ideas?!
 
Use TEXTAREA
Code:
<TEXTREA cols=40 rows=5><%=rs(&quot;fieldname&quot;)%></TEXTAREA>

________
George, M
 
If you aren't putting it in a text area try using something along the lines of;

yourVar = replace(yourField,&quot;vbCrLf&quot;,&quot;<br>&quot;)
response.write yourVar

If this doesn't work then it may need to be used within your original submit page so the line breaks are saved, infact this seems more likely (its been a while).

DaveJam
 
oops, looking through code and i don't think you need the speach marks round vbCrLf, and i'm pretty sure you need to replace before you run the insert / update script to the table.

DaveJam
 
thanks for the replies guys!

Davejam - you actually came up with something similar to what I had originally tried - I had

<%=(rsRecordset.Fields.Item(&quot;Column&quot;).Value,chr(13),&quot;<br>&quot;)%>

but it wouldn't work, tried all sorts of combinations. maybe that vbCRLf will do the trick! I'll have to try it in the morning!!
 
what was this supposed to do?

<%=(rsRecordset.Fields.Item(&quot;Column&quot;).Value,chr(13),&quot;<br>&quot;)%>


try something like this

<%=rsRecordset(&quot;Column&quot;)&&quot;<br>&quot;%>

good luck
 
ermm - sorry, late at night, was supposed to say:

<% =replace(scheme.Fields.Item(&quot;inforeq&quot;).Value , chr (13) , &quot;<br>&quot;)%>

which is what would not work, however

<% =replace(scheme.Fields.Item(&quot;inforeq&quot;).Value , vbCrLf , &quot;<br>&quot;)%> (changing the chr (13) for vbCrLf) works absolutely perfectly!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top