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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Outputting Varaible Field Names 2

Status
Not open for further replies.

KevinFSI

Programmer
Nov 17, 2000
582
US
Guys, I'm stuck.

I have a form that loops over records in my DB and puts a text box at the end of the row for each record. There are numerous job codes in the DB and the text box is to input hours for each job. I've given the input box the name corresponding to the primary key value for the job code it represents.
Code:
<INPUT TYPE=&quot;text&quot; NAME=&quot;#task_codes_pkey#&quot; MAXLENGTH=&quot;5&quot; SIZE=&quot;4&quot;>
When I go to output the data is where I get stuck, since I don't know what the field was named.

This is where you all come in. How can I output variables that were sent to the output page as variable field names?

To clarify a little more, the data comes into the output page like so:
Code:
Parameters
Form Fields:

839=132
840=321
841=456
842=654

So, as you can see, I'm never going to know what my field names are in order to display them. Any ideas?

Thanks a million, all Kevin
slanek@ssd.fsi.com
 
Hey Kevin,

To output a variable field name, just use the evaluate() function like this.

<cfquery name=&quot;q1&quot;>

<cfoutput>#evaluate(&quot;#task_codes_pkey#&quot;)#</cfoutput>

</cfquery>

Hope this helps,
GJ
 
My friend, you are the man! Thanks! Kevin
slanek@ssd.fsi.com
 
GJ,
That works for getting the variable field name, but I guess I'm still fuzzy on how to output what was put into the text box. Kevin
slanek@ssd.fsi.com
 
GJ,
Nevermind, I got it. Thanks again for the help! Kevin
slanek@ssd.fsi.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top