Solved

Referring to a variable as a String

Posted on 2000-05-17
4
141 Views
Last Modified: 2013-12-24
I have a form that consists of a dynamically-generated set of form fields. Thus, I have fields of unknown nmae coming into my form-processing page.  (they're identified with an ID number).  

How can I get the value of these form fields, if I can't hardcode the names of the fields ahead of time?

e.g. several sets of radio buttons are created, each set having a unique name identifier.  I can know the names of them coming in via hidden form fields generated later, but I can't access the values of the fields, since I can't refer to FORM.#myval# or something like that....
0
Comment
Question by:IsleOfView
  • 3
4 Comments
 

Author Comment

by:IsleOfView
ID: 2818182
Adjusted points from 200 to 300
0
 

Author Comment

by:IsleOfView
ID: 2818183
Increased points to 300...

Maybe if I just had the query string, I could get what I needed....how can I get that?  (This is a result of a POST operation)
0
 
LVL 2

Accepted Solution

by:
paulkd earned 300 total points
ID: 2818443
Use the Form.FormField field which is passed from all forms....

Insert this code on your action page

<CFIF ISDefined("Form.Fieldnames")>
  <table border="1">
    <CFOUTPUT>
      <CFLOOP Index="FieldName" List="#Form.Fieldnames#">
        <td>Form.#FieldName#</td> <td>#Evaluate(FieldName)#&nbsp;</td></tr>
      </CFLOOP>
    </CFOUTPUT>
  </table>
</CFIF>

Note: that radio buttons and checkboxes will not return a field if they are not selected/checked, so have a default radio button checked.
0
 

Author Comment

by:IsleOfView
ID: 2818846
Thanks....that worked great--enjoy the points...I needed a fast answer!
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now