This is the form:
<form action="updatecontent.cfm" method="post">
<input type="hidden" name="HowMany" value="<cfoutput>#getcontent.recordcount#</cfoutput>">
<cfoutput query="getcontent">
<input type="hidden" name="ContentId#CurrentRow#" value="#ContentId#">
<b>Content:</b><br>
<textarea cols="50" rows="5" name="ContentText#CurrentRow#">#ContentText#</textarea>
</cfoutput>
<br><br>
<div align="center"><input type="submit" value="Update Content"></div>
</form>
And here is the update page:
<cfloop index="i" from="1" to="#form.HowMany#">
<cfset ContentText = Replace("form.ContentText" & i, "#chr(13)##chr(10)#", "<br>" , "all"
>
<cfset ContentId = "form.ContentId" & i>
<cfquery name="updatecontent" datasource="icebulls" dbtype="ODBC">
UPDATE Content
Set ContentText = '#Evaluate(ContentText)#' WHERE ContentId = #Evaluate(ContentId)#
</cfquery>
</cfloop>
The only thing I can think of is that I messed up the syntax in the <cfset> for ContentText due to the replace AND counter... Any insight??
<form action="updatecontent.cfm" method="post">
<input type="hidden" name="HowMany" value="<cfoutput>#getcontent.recordcount#</cfoutput>">
<cfoutput query="getcontent">
<input type="hidden" name="ContentId#CurrentRow#" value="#ContentId#">
<b>Content:</b><br>
<textarea cols="50" rows="5" name="ContentText#CurrentRow#">#ContentText#</textarea>
</cfoutput>
<br><br>
<div align="center"><input type="submit" value="Update Content"></div>
</form>
And here is the update page:
<cfloop index="i" from="1" to="#form.HowMany#">
<cfset ContentText = Replace("form.ContentText" & i, "#chr(13)##chr(10)#", "<br>" , "all"
<cfset ContentId = "form.ContentId" & i>
<cfquery name="updatecontent" datasource="icebulls" dbtype="ODBC">
UPDATE Content
Set ContentText = '#Evaluate(ContentText)#' WHERE ContentId = #Evaluate(ContentId)#
</cfquery>
</cfloop>
The only thing I can think of is that I messed up the syntax in the <cfset> for ContentText due to the replace AND counter... Any insight??