Solved

Referring to a variable as a String

Posted on 2000-05-17
4
143 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

813 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

16 Experts available now in Live!

Get 1:1 Help Now