Skip to main content
Inspiring
June 3, 2014
Answered

Processing ColdFusion variables which resides inside a database table

  • June 3, 2014
  • 1 reply
  • 353 views

One of my table is saving an HTML form which contains coldfusion variables. In my code I am querying this table and I need to display this form in the front end. But while dsiplaying I am getting the coldfusion variable name itself instead the processed value of the variables.

HTML Form saved in the db table:

================================

    <form action="" name="ci_entry_form" id="ci_entry_form" method="post">

    <table width="100%" height="100%" border="0">

    <tr>

    <td align="right"><b style="color:red">*</b> <label class="pop_up_letter_font">G/L #     :</label></td>

    <td>    <input class="pop_up_textbox" type="text" name="gl_number_text" id="gl_number_text" maxlength="21" value="#ARGUMENTS.chkDetails.GL_ACCT_NBR#" required/>   

    <select class="pop_up_dd" name="gl_number_drop" id="gl_number_drop" onChange="enableDisableGL()">

    <option value="">---Select---</option>

    <option value="new">Enter a new G/L number</option>

    <cfoutput query="glNumbers">

    <option value="#glNumbers.GL_ACCT_NBR#">#glNumbers.GL_ACCT_NBR#</option>

    </cfoutput>

    </select>

    </td>       

    </tr>

    </table>

    </form>

Method (cffunction) contains below code to query this html form from db table and return the html form.

============================================================================================

    <cfquery name="qry_getTemplate" datasource="#APPLICATION.dsn#">

    select FORM_TXT from HTML_FORMS where REQ_ID = 172

    </cfquery>

    <cfsavecontent variable="form_content">

    <cfoutput>#qry_getTemplate.FORM_TXT #</cfoutput>

    </cfsavecontent>

But when I dump the cfcontent variable (form_content ) I am getting the HTML Form without processing the coldfusion variables (**#ARGUMENTS.chkDetails.GL_ACCT_NBR# , #glNumbers.GL_ACCT_NBR#**).

Am I missing something. Can any one help me out resolve this.

Your timely help is well appreciated.

Thanks in advance.

This topic has been closed for replies.
Correct answer BKBK

Add cfoutput tag:

<cfoutput> <input class="pop_up_textbox" type="text" name="gl_number_text" id="gl_number_text" maxlength="21" value="#ARGUMENTS.chkDetails.GL_ACCT_NBR#" /> </cfoutput> 

1 reply

BKBK
Community Expert
BKBKCommunity ExpertCorrect answer
Community Expert
June 3, 2014

Add cfoutput tag:

<cfoutput> <input class="pop_up_textbox" type="text" name="gl_number_text" id="gl_number_text" maxlength="21" value="#ARGUMENTS.chkDetails.GL_ACCT_NBR#" /> </cfoutput>