Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 158
  • Last Modified:

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
0
swapg
Asked:
swapg
1 Solution
 
JKevinCommented:
<cfinput type="text" name="#FORM.id#">

will work
0
 
pganeshanCommented:

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.

0
 
swapgAuthor Commented:
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.

0
How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

 
ssoniCommented:
Two possible scenarios:

If you can generate the same query on the action page u can re-generate the names there.

In your first page make the input field names a little more predictable for example u can have

<cfinput type="text" name="text_#id#">

Now on the action page u loop through the FORM collection and look for all variable names matching "text_". That way u can achieve it.

Hope this helps.

Soni.
0
 
JKevinCommented:
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.
0
 
JKevinCommented:
Oh.. and I didn't know the SOP.  Sorry for posting my first reply as an answer.

-JKC
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now