I would like to know if any of the string functions in Coldfusion can
detect and/or count the number of hard returns inside of a text string.
The outcome that I am looking for is to dynamicly calculate the number of
rows for the textarea that I display the string's content inside of.  I
need to be able to detect and count the number of hard returns inside this
string and add that many rows to the request.rownum calculation so that the
entire string is visible inside the textarea box.

Here is a snippet of my current code.

<cfset st=REFindNoCase("([ ])
+(\1)",qGet_MeetingMinutes.MM_BodyOfMeeting,1,"TRUE")> (this line was my
attempt at finding blank spaces longer then 1 space within the text string
- it didnt work.)
<cfset request.RowNum=(len(qGet_MeetingMinutes.MM_BodyOfMeeting)/66)+3>

<textarea name="BodyOfMeetingMinutes" cols="66" rows="#request.RowNum#"
wrap="soft">#trim(qGet_MeetingMinutes.MM_BodyOfMeeting)#</textarea>

Note: the field ".MM_BodyOfMeeting" is a text field (of default length) in
our SQL Database.

This works fine as long as there is no hard returns or long series of
spaces inside of it.  If this column is blank the textarea defaults to 3
rows.  I have looked through my coldfusion books and the online help with
no success.  If anyone has any suggestions please reply to me off list.
Thanks.


Ryan Williams
[EMAIL PROTECTED]


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to