Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Output Query Result as an output variable.

Status
Not open for further replies.

jmcg

Technical User
Jun 30, 2000
223
GB
I am trying to return data from dynamically produced form fields.
I have a query
Code:
<CFQUERY datasource=&quot;BMTGen&quot; name=&quot;Questions&quot;>
SELECT BRQuestions.QuestionNum
FROM BRQuestions
</CFQUERY>
which produces the filednames (Q1, Q2, etc) I want to return, ie QuestionNum, however I cannot find out how to use that in the form output.
When I try
Code:
#form.QuestionNum#
, it looks for a field called QuestionNum instead of form.Q1, form.Q2, etc.
I am sure I am missing something simple, any help much appreciated.
jmcg
 
Use the name of your query ie, #Questions.QuestionNum#. I don't understand why your trying to use #form.# but if you want to populate a form field, use
<form>
<input type=&quot;text&quot; name=&quot;Q1&quot;value=&quot;#Questions.QuestionNum#&quot;>
</form>
 
sknyppy
Thanks for the reply.
I have a form which is created like you show except the name of the field is popluate with the output:
Code:
<input type=&quot;text&quot; name=&quot;#Questions.QuestionNum#&quot;>
What I am then trying to do is output the form results but I need to know the name of the field to output, ie
Code:
#Questions.QuestionNum#
.
Another possible way around might be if there is a way to output all form fields without specifying a field name.
Any further help would be great.
John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top