Solved

Referring to a variable as a String

Posted on 2000-05-17
4
145 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…

733 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