I am confused. Down in your code, you have <cfif #FIELD# is 1>. Where should FIELD be coming from? Your getindiv query? Another of your queries? The form that from the previous page?
> -----Original Message----- > From: Molly Abraham [mailto:[EMAIL PROTECTED] > Sent: Tuesday, November 29, 2005 9:13 AM > To: CF-Talk > Subject: HELP!! Query - Loop - List - Form Madness > > Hi. . . hope someone can help. . . (PLEASE BEAR WITH ME -- > THIS IS ALL HIGGLEDYPIGGLEDY) we are having a problem > displaying the value of a query variable. . it seems really > confusing, and it is - but unfortunately this is the simplest > way we can think of to do this. > > Our goal is to run a query to check and see what proposals > (proposalid) have been submitted, create a table with column > for each proposalid that also contains one row for each of > the seven proposal 'readers'. (this part works) > > The readers then grade the proposals using an online form. > Explanation of what we are doing is below. . . . BUT HERE IS > THE PROBLEM WE ARE HAVING -- the 'readers' are able to log > in repeatedly to input their 'grades', change them etc. . . > which means we have to be able to capture the value stored in > a given field. . . ex: > <cfquery name"" datasource""> select proposalcolumn from > grades where reader = currentreader</cfquery> > The problem is that we do not know the name of the column!! > and for the life of us we cannot figure out what variable to > set, etc. . which would let us output this value!! > > > Each reader reads only ~half of the proposals, as they are > divided up by region. So, once the reader logs into the > reader 'grading' section -- we create a session variable to > denote which region they are from. On the 'grading' form > page we then use the session variable to get only the columns > for the grading table that correspond to the proposals they > were assigned to read. > > ON THE GRADING FORM PAGE WE DO THIS TO GET THE DATA NEEDED TO > CREATE THE FORM. > > <cfquery name="getproposals" datasource="sotl"> > select * > from proposal06 > where readinggroup = #session.group# > and status = 1 > order by proposalid asc > </cfquery> > > <cfset proposals = ''> > > <cfoutput query="getproposals"> > > <cfset proposals = '#listappend(proposals,proposalid)#'> > </cfoutput> > > THEN WE LOOP THE PROPOSALS LIST TO QUERY THE GRADES TABLE > (PROPOSALID = GRADES.COLUMNNAME) > > <cfloop list="#proposals#" index="i"> > <cfquery name="getgrades" datasource="sotl"> > select #i# > from grades06 > where readerid = #session.readerid# > </cfquery> > > > THEN WE LOOP THE GETGRADES QUERY TO POPULATE THE GRADING FORM > WITH THE APPROPRIATE PROPOSAL FORM FIELDS > > <cfloop list="#getgrades.columnlist#" index="i"> > > <tr> > > <cfoutput> <td><strong>#i#</strong></td> > > THEN WE RUN THIS QUERY TO GET THE VALUE OF THE SPECIFIC FIELD > (PREVIOUSLY SUBMITTED GRADE STORED IN THE TABLE > > <!---get the grade for this proposal - based on column name > from looping columnlist ---> > <cfquery name="getindiv" datasource="sotl"> > select #i# > from grades06 > where readerid = #session.readerid# > </cfquery> > > <td>Accept: > <!--- Should checkbox be pre-checked? ---> > !!!!!AND FINALLY -- IF YOU WADED THROUGH ALL OF THIS -- HERE > IS THE PROBLEM -- HOW CAN WE REFERENCE THIS FIELD -- EVEN > THOUGH WE DON'T KNOW THE FIELD NAME???? -- WE HAVE TRIED > EVERYTHING WE CAN THINK OF (admittedly/obviously not that > much) AND CAN'T GET IT TO WORK!!!!!!!!!!! > <cfif #FIELD# is 1> > <CFSET IsChecked = 'Yes'> > <cfelse> > <CFSET IsChecked = 'No'> > </cfif> > <!--- Checkbox itself ---> > <cfinput > type="radio" > name="#i#" > checked="#IsChecked#" > value="1"></td> > <td>Reject: > <!--- Should checkbox be pre-checked? ---> > <cfif '#column#' eq 0> > <CFSET IsChecked = 'Yes'> > <cfelse> > <CFSET IsChecked = 'No'> > </cfif> > <!--- Checkbox itself ---> > <CFINPUT > TYPE="radio" > NAME="#i#" > checked="#IsChecked#" > VALUE="0"> </td> > <td>Maybe: > <!--- Should checkbox be pre-checked? ---> > <cfif '#column#' eq ''> > <CFSET IsChecked = 'Yes'> > <cfelse> > <CFSET IsChecked = 'No'> > </cfif> > <!--- Checkbox itself ---> > <CFINPUT > TYPE="radio" > NAME="#i#" > checked="#IsChecked#" > VALUE="2"> </td> > <td>Not Yet Graded: > <!--- Should checkbox be pre-checked? ---> > <cfif '#column#' eq ''> > <CFSET IsChecked = 'Yes'> > <cfelse> > <CFSET IsChecked = 'No'> > </cfif> > <!--- Checkbox itself ---> > <CFINPUT > TYPE="radio" > NAME="#i#" > checked="#IsChecked#" > VALUE="3"> </td></cfoutput> > </tr> > </cfloop></cfloop> > <tr> > > Please take pity on us if you can! If you can make sense of > this. Thank you. > M > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225635 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54