Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Passing associated values with selected item in CFFORM?

New Here ,
Oct 30, 2012 Oct 30, 2012

I query a database for names and different grades for subjects.  For example, I requested for "Mary" and the database returns more than one "Mary".  So I displayed the different "Mary" with a cfform and list all the "Mary" with a radio button and let user choose the right "Mary".

e.g.

cfquery...

if more than one student with same name then

<cfform action="nextprogram">

<cfoutput query=list>

<cfinput type=radio name=studentname value=#studentname#>#studentname#, #studentlastname#

<cfinput type=hidden name=math value=#math#>

<cfinput type=hidden name=physic value=#physic#>

....

</cfoutput>

</cfform>

Of course, I realize this will not work because if there are 10 "Mary" and I select the first "Mary", the application will not know which math, physic grades etc. belong to the first "Mary". Since I have already done the database query with all the information retrieved, I don't want to do a database query again.  How do I pass the all the information belong to the chosen "Mary" to the "nextprogram"?   This is probably very easy to do with different CF tag, but I haven't used Coldfusion for a while, so any help is appreciated.  Thank you.

Jack

636
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 30, 2012 Oct 30, 2012

Instead of value = studentname, use value = studentid

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 30, 2012 Oct 30, 2012

Hi Dan,

Even if I pass studentid that still won't work. I still need to somehow pass all the grades associated with the selected studentid to the secondprogram. 

Jack

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 30, 2012 Oct 30, 2012

You could always pass a list and process it on the next page.  Something like

name=Mary Smith,physics=85,math=50

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 30, 2012 Oct 30, 2012
LATEST

The user select the right "Mary" from a list of names starting with "Mary" via input radio button.  I need to find a way to pass all the retrieved information for the selected Mary through the form.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources