Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Display #value# from database in field

New Here ,
Sep 21, 2009 Sep 21, 2009

(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.

631
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Sep 25, 2009 Sep 25, 2009

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...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 26, 2009 Sep 26, 2009
LATEST
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>.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources