Quantcast
Channel: Adobe Community : Unanswered Discussions - ColdFusion
Viewing all articles
Browse latest Browse all 5794

Problem/Question Regarding Form Variables and Nesting?

$
0
0

Hello,

 

I need to create a rather long list of checkboxes for a user to fill out.  I have created a database table with each checkbox item stored as a row, and using a cfquery I can select them from the database and add them to a form as such:

 

<form action="postact.cfm" method="post">

    

     <cfoutput query="getquestions">

           

            <input type="checkbox" name=#getquestions.shortname#>#getquestions.longname#<br>

 

      </cfoutput>

    

  <input type="submit" value="Submit">

 

</form>

 

The problem is when I try to reference these items on the following page.

 

Instead of naming each one individually, I was hoping to use another query to pull the name of the checkbox, and be able to reference it.

 

Problem seems to be that I can't reference them as a variable name, I thought I could do something like this:

 

<cfoutput query="getquestions">

#form.shortname#

</cfoutput>

 

..but that doesn't work because #form.shortname# isn't a valid variable.  What I really need is #form.#getquestions.shortname##, if that makes sense.  Is that possible?  Nesting a variable name inside a variable name?


Viewing all articles
Browse latest Browse all 5794

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>