Link to home
Start Free TrialLog in
Avatar of swapg
swapg

asked on

value of variable

For an application i'm using dynamically generated Text fields
<cfoutput query...>
<cfinput type="text" name="#id#">
In the action page of this form.
I want value of the text fields

i.e i want the value of #form.#id##(????????).
I tried Evaluate but its not working....


RASAP
Avatar of JKevin
JKevin

<cfinput type="text" name="#FORM.id#">

will work

JKevin,
Thanks for ur Suggestion, but this won't solve my problem.

I think u have interpreted it wrongly.
As i have to define <cfinput...
in the form page with dynamic names for the text fields as it is used in the Query output & read them in action page.

I hope i'm clear now.

Avatar of swapg

ASKER

JKevin,
Thanks for ur Suggestion, but this won't solve my problem.

I think u have interpreted it wrongly.
As i have to define <cfinput...
in the form page with dynamic names for the text fields as it is used in the Query output & read them in action page.

I hope i'm clear now.

ASKER CERTIFIED SOLUTION
Avatar of ssoni
ssoni

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Oh, I get it now.

I've done this before in two ways.  

Either with JavaScript which generates the form using variables supplied by the CF server (this is the more complicated solution, but more flexible)

OR

Totally with CF using lists.  Create a list (dynamic of course).  Each item in the list is a new text field name.
To retrieve the value of the form field, loop over the list. This is similar to Soni's solution except it stores the filed names in an explicit list that you can manipulate more easily than the FORMS collection. (ie you don't need to search the collection for specific types of filed names)
the downside is that you have to create and manage the list.
Oh.. and I didn't know the SOP.  Sorry for posting my first reply as an answer.

-JKC