Copy link to clipboard
Copied
(Simplified example - feel free to ask for more info)
I've got a cf application which displays a summary page
<cfoutput query="summaryInfo">
Times: #timeFormat(bookingStart, "hh:mm")# - #timeFormat(bookingEnd, "hh:mm")#
Notes: #notes#
Replies: #replies#
</cfoutput>
This all works fine. As well as a table of bookings, there is a table of replies for ease of use (select the replies you want from a list, then edit and add free text). [e2a - these replies are then saved in the db as the #replies# field above [/e2a] This works fine too.
My problem is this:
I've got one reply which is
"Please be available at #bookingStart# for instruction"
i.e. I potentially have the above table showing
Times: 8.30-9.30
Notes: Stuff to do
Replies: Please be available at #bookingStart# for instruction
Ideally I'd like the #bookingStart# to automatically detect what this time is.
The more I think about this the more I wonder why I don't get an error for having # 's in the replies field.
Copy link to clipboard
Copied
Okay, I'm not sure how you are saving the reply field with #bookingStart# which is the problem for me (saving, not displaying). In any case, if you want to keep things like this just do
<cfoutput query="summaryInfo">
Times: #timeFormat(bookingStart, "hh:mm")# - #timeFormat(bookingEnd, "hh:mm")#
Notes: #notes#
Replies: #Replace(replies,"#bookingStart#",timeFormat(bookingStart, "hh:mm") ,"ALL")#
</cfoutput>
Let me know if it's working...
Copy link to clipboard
Copied
Please be available at #bookingStart# for instruction
In my opinion, you shouldn't find a workaround for this, but the cause and the solution. To start with, it is an error for that line to be in the database.
The cause and the solution: Retrace your steps back to where the code inserts that line into the database. It is very likely that you mistakenly inserted #bookigStart#, instead of <cfoutput>#timeFormat(bookingStart, "hh:mm")#<cfoutput>.