macromedia.coldfusion.getting_started
[Top] [All Lists]

Re: output of query gives unwanted whitespace

Subject: Re: output of query gives unwanted whitespace
From: "Snakes3680"
Date: Mon, 7 Jul 2008 09:15:48 +0000 UTC
Newsgroups: macromedia.coldfusion.getting_started

Ok, some extra info:

 I'm using  (richttext) cftextarea to gather a html-structured text.      That 
text has to be written to a database.    So I chunk the text up in parts of 300 
characters and write those parts of 300 chars to the database.   I use this 
code:

 <cfset myText = contentOfTextarea... >

 <cfloop condition="len(myText) GT 0">  
        <cfset counter=counter+1>       
        <cfset myString=left(myText,300)>       
        <cfif len(myText) GT 300>
                <cfset myText=mid(myText,301,len(myText)-300)>
        <cfelse>
                <cfset myText="">
        </cfif>         
        <cfquery name="qryPasInhoudAan" datasource="ecolife">           
                insert into database...
        </cfquery>
 </cfloop>

 Later, when I try to display the text - that was written or edited with the 
cftextarea -  I use the following code:

 <cfquery name="pagina_inhoud" datasource="ecolife">
        SELECT inhHtml FROM pov_inhoud where inhPaginaId=#thisPage#
 </cfquery>     
             
   <cfloop 
        query = "pagina_inhoud"
        startRow = "1"
        endRow = "#pagina_inhoud.RecordCount#">
              <cfoutput>#pagina_inhoud.inhHtml#</cfoutput>
 </cfloop>

 So the problem remains that between every part of (300 chars of ) html cf puts 
a spaces which makes some html-tages not work because there is a space in them. 
 I get things like </ p> in my resultpage.

 I ' ve also tried trimming but the white space does not come from the database 
so trimming doesn't helps me out.



<Prev in Thread] Current Thread [Next in Thread>