House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

Finding the right FORM field

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
How is this:
Morgan Senkal
05/25/04 01:49 P
Just use this instead:
Raymond Camden
05/25/04 02:00 P
> From: Morgan Senkal
Philip Arnold
05/25/04 02:02 P
Simple, change this:
Semrau Steven Ctr SAF/IE
05/25/04 03:45 P
Thanks so much everyone!
Morgan Senkal
05/25/04 07:46 P
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Morgan Senkal
05/25/2004 01:49 PM

How is this: Evaluate("SELPROJECT" & issueID) (issueID is a variable) Equal to this?: Error resolving parameter SELPROJECTFORM.IDLISTA Here is the whole code: <cfloop index="issueID" list="FORM.idListA"> <cfquery datasource="Tribal_Matrix" name="getProject"> SELECT * FROM v_Project WHERE Project_Nm = #StructFind(FORM,Evaluate("SELPROJECT" & issueID))# </cfquery>     </cfloop> Basically I'm looping thru a list of numbers.  All the FORM fields have established names with one of these numbers at the end, I'd like to loop thru those field names in groups based on the number at the end. So the one in question above would look like FORM[SELPROJECT45]    Perhaps I need an explanation of how Evaluate() works...and variables in loops too.  Thanks for any help!

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Raymond Camden
05/25/2004 02:00 PM

Just use this instead: form["selproject" & issueid] example: where Project_Nm = #form["selproject" & issueid]#

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Philip Arnold
05/25/2004 02:02 PM

> From: Morgan Senkal > > <cfloop index="issueID" list="FORM.idListA"> <cfloop index="issueID" list="#FORM.idListA#"> > #StructFind(FORM,Evaluate("SELPROJECT" & issueID))# #form["SELFPROJECT#issueID#"]# Also CFQUERYPARAM!!!

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Ben Doom
05/25/2004 02:05 PM

> WHERE Project_Nm = #StructFind(FORM,Evaluate("SELPROJECT" & issueID))# > WHERE Project_Nm = #FORM["SELPROJECT" & issueID]# Try that.  Should work better.  Or should tell you issueID contains the wrong data. --Ben Doom

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Pascal Peters
05/25/2004 02:04 PM

Maybe like this (if form.idListA contains a list of numbers) <cfloop index="issueID" list="#FORM.idListA#"> <cfquery datasource="Tribal_Matrix" name="getProject"> SELECT * FROM v_Project WHERE Project_Nm = #FORM["SELPROJECT" & issueID]# </cfquery>     </cfloop> If form.idListA contains the maximum maybe it should be: <cfloop index="issueID" from="1" to="#FORM.idListA#"> <cfquery datasource="Tribal_Matrix" name="getProject"> SELECT * FROM v_Project WHERE Project_Nm = #FORM["SELPROJECT" & issueID]# </cfquery>     </cfloop> ----- Excess quoted text cut - see Original Post for more -----

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Semrau Steven Ctr SAF/IE
05/25/2004 03:45 PM

Simple, change this: <cfloop index="issueID" list="FORM.idListA"> to: <cfloop index="issueID" list="#FORM.idListA#"> You just need to identify the list coming from a variable - otherwise it's reading (FORM.idListA) as the actual listing. HTH How is this: Evaluate("SELPROJECT" & issueID) (issueID is a variable) Equal to this?: Error resolving parameter SELPROJECTFORM.IDLISTA Here is the whole code: <cfloop index="issueID" list="FORM.idListA"> <cfquery datasource="Tribal_Matrix" name="getProject"> SELECT * FROM v_Project WHERE Project_Nm = #StructFind(FORM,Evaluate("SELPROJECT" & issueID))# </cfquery> </cfloop> Basically I'm looping thru a list of numbers.  All the FORM fields have established names with one of these numbers at the end, I'd like to loop thru those field names in groups based on the number at the end. So the one in question above would look like FORM[SELPROJECT45] Perhaps I need an explanation of how Evaluate() works...and variables in loops too.  Thanks for any help!   _____  

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Morgan Senkal
05/25/2004 07:46 PM

Thanks so much everyone! The solution was a combination of the suggestions offered: Yes, I had to change the #StructFind(FORM,Evaluate("SELPROJECT" & issueID))# to the suggested #FORM["SELPROJECT" & issueID]# The problem with that however, is that's where I had started but it didn't work.   So that's when I headed down the evaluate path.  But if I returned to my original code and also changed <cfloop index="issueID" list="FORM.idListA"> to <cfloop index="issueID" list="#FORM.idListA#"> Then presto, the whole shebang fires off like a dream :-) You guys rock! I knew it would be something simple.  It always is :P


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

May 24, 2012

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
     1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31     

Designer, Developer and mobile workflow conference