post.72
post.72

Reputation: 333

cfset or cffunction?

In coldfusion, in the hidden values of a form I get two values:

            <input type="hidden" name="EST_VAL" value="#EST_VAL#" />
            <input type="hidden" name="DOWN_PMT" value="#DOWN_PMT#" />

I need to find the value of EST_VAL subtracted from DOWN_PMT and assign it to this value:

            <input type="hidden" name="LOAN_VAL" value="#LOAN_VAL#" />

I know how to do this in PHP, but I'm not sure if I should use a cfset, or cffunction in coldfusion.

Upvotes: 0

Views: 326

Answers (2)

craig.kaminsky
craig.kaminsky

Reputation: 5598

CFSET should be all you need for this. Without seeing the other code in this file/script, a simple approach/solution would entail the following:

<cfset LOAN_VAL = EST_VAL - DOWN_PMT />

That would then output the value of the LOAN_VAL variable in the hidden field tag you note in your original post.

Upvotes: 4

Mark A Kruger
Mark A Kruger

Reputation: 7193

you can do this inline with pound signs like so:

<input type="hidden" name="LOAN_VAL" value="#EST_VAL-DOWN_PMT#"/>

Upvotes: 7

Related Questions