I am building a site for a church and am setting up a page for the pastor to input his on thoughts as he sees fit. In the database (access) it has spaces where spaces need to be and you can see where one paragraph ends and the other starts but when I pull it to a page as dynamic text, it all jumbles together in 1 paragraph. can someone help me. Thanks strings41
you need to convert your vbcrlf (line feed) into html breaks or paragraphs, i.e. something like pastor_comments = replace(your_recordset("comment_field"), vbcrlf, "<p>") response.write pastor_comments
Where do I put what you told me: <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <!--#include file="Connections/thirtyfirst.asp" --> <!--#include file="Connections/thirtyfirst.asp" --> <!--#include file="Connections/thirtyfirst.asp" --> <% Dim rs02__MMColParam rs02__MMColParam = "1" If (Request.QueryString("text") <> "") Then rs02__MMColParam = Request.QueryString("text") End If %> <% Dim rs02 Dim rs02_numRows Set rs02 = Server.CreateObject("ADODB.Recordset") rs02.ActiveConnection = MM_thirtyfirst_STRING rs02.Source = "SELECT * FROM texts WHERE ID = " + Replace(rs02__MMColParam, "'", "''") + "" rs02.CursorType = 0 rs02.CursorLocation = 2 rs02.LockType = 1 rs02.Open() rs02_numRows = 0 %> <% Dim Repeat1__numRows Dim Repeat1__index Repeat1__numRows = 10 Repeat1__index = 0 rs02_numRows = rs02_numRows + Repeat1__numRows %> <% Dim MM_paramName %> <% ' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters Dim MM_keepNone Dim MM_keepURL Dim MM_keepForm Dim MM_keepBoth Dim MM_removeList Dim MM_item Dim MM_nextItem ' create the list of parameters which should not be maintained MM_removeList = "&index=" If (MM_paramName <> "") Then MM_removeList = MM_removeList & "&" & MM_paramName & "=" End If MM_keepURL="" MM_keepForm="" MM_keepBoth="" MM_keepNone="" ' add the URL parameters to the MM_keepURL string For Each MM_item In Request.QueryString MM_nextItem = "&" & MM_item & "=" If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then MM_keepURL = MM_keepURL & MM_nextItem & Server.URLencode(Request.QueryString(MM_item)) End If Next ' add the Form variables to the MM_keepForm string For Each MM_item In Request.Form MM_nextItem = "&" & MM_item & "=" If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then MM_keepForm = MM_keepForm & MM_nextItem & Server.URLencode(Request.Form(MM_item)) End If Next ' create the Form + URL string and remove the intial '&' from each of the strings MM_keepBoth = MM_keepURL & MM_keepForm If (MM_keepBoth <> "") Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1) End If If (MM_keepURL <> "") Then MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1) End If If (MM_keepForm <> "") Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1) End If ' a utility function used for adding additional parameters to these strings Function MM_joinChar(firstItem) If (firstItem <> "") Then MM_joinChar = "&" Else MM_joinChar = "" End If End Function %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Results</title> <style type="text/css"> <!-- .style1 { font-size: 24px; font-weight: bold; color: #990099; } --> </style> </head> <body> <p align="center" class="style1">MBC<br /> Administration Page </p> <p align="center">_________________________________________________________</p> <p align="center"> </p> <div align="center"> <table width="442" border="0"> <tr> <td width="442"><div align="left">Message:</div></td> </tr> <% While ((Repeat1__numRows <> 0) AND (NOT rs02.EOF)) %> <tr> <td width="442"><div align="center"> <p align="left"><A HREF="/detail.asp?<%= Server.HTMLEncode(MM_keepURL) & MM_joinChar(MM_keepURL) & "ID=" & rs02.Fields.Item("ID").Value %>">Edit</A></p> <div align="left"> <pre><%=(rs02.Fields.Item("ppage").Value)%></pre> </div> </div></td> </tr> <% Repeat1__index=Repeat1__index+1 Repeat1__numRows=Repeat1__numRows-1 rs02.MoveNext() Wend %> </table> </div> <div align="center"></div></body> </html> <% rs02.Close() Set rs02 = Nothing %>
It's kinda hard to say from this. You need to look at the string of the paragraphs as they come out on the server side and see what the line breaks look like. If they are vbcrlf, or \r\n or whatever, and as vectorgraphx said, replace them with something like a couple <br /> or something. A <p> tag might be best for a paragraph, but adds a little bit of complexity since you have to wrap the paragraph with one on either side (before and after) of it. I see a loop of things being repeated and entered on the page. Is "ppage" by chance the variable for the text? I wouldn't think id is, and it is part of a link... Hope that helps some.
I think this is where you should do that <pre><%=(rs02.Fields.Item("ppage").Value)%></pre> ---------------- <% strPPage = replace(rs02.Fields.Item("ppage").Value, vbcrlf, "<p>") %> then in YOUR <pre> TAG <pre><%=strPPage%></pre> You might wanna remove PRE also
consider using a html wysiwyg editor. Free one like the FCK editor or a commercial one like teleriks or infragistics.
I donno what happened but my moderator might have not noticed that i corrected the syntax ... for my friend .... If helping means something else then i m sorry ....