ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old October 11th, 2004, 09:07 AM
mikemac mikemac is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: Greenville NC
Posts: 70 mikemac User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 15 m 24 sec
Reputation Power: 4
Question Dynamically assigning SESSION vars to form input

I am having one heck of a time with CFLOOP to assign SESSION variables dynamically.
On the loop in question below here is my mindset. What this loop is doing is assigning a single SESSION variable to each form field input provided by the user.
When this loop executes I get the following error…..
<!---
Invalid CFML construct found on line 16 at column 24.
ColdFusion was looking at the following text:#The CFML compiler was processing:

* a cfset tag beginning on line 16, column 2.
* a cfset tag beginning on line 16, column 2.


-


<!--- Here is the code-
<CFSET M=1>
<CFSET k=1>
<body>

<CFLOOP from="1" to="#SESSION.NumberOfQuest#" index="i" step="1">
<CFOUTPUT>

<cfset SESSION.Question#M#=FORM.question#M#>

<cfset SESSION.CorrectAnswer#M#=FORM.correctAwn#M#>
</CFOUTPUT>


<!---inner question loop, loops #SESSION.NumOfAwnz# times--->
<CFLOOP from="1" to="#SESSION.NumOfAwnz#" index="j" step="1">
<CFIF "#k#" GT "#SESSION.NumOfAwnz#">

</CFIF>
<CFOUTPUT>
<cfset SESSION.Answer#a#=FORM.answer#i#.#k#><CFOUTPUT>
</CFOUTPUT>
<cfset k=k+1></TD></CFOUTPUT>

</CFLOOP>
</CFLOOP>
<CFFORM action="dataInsert.cfm" method="post">
<TR><TD><input type="submit" value="finished"></TD></TR>
</CFFORM>
Here is the goal of my forms.
Form1.Create a form to accept user input (DONE)
Form2.Create a form based on user input from Form1(DONE)
Form3. Assign user input from Form2 to session variables(PROBLEMS!!!)
Form4. Input each session variable from Form3 into database(NEXT)
-------------------------------------------
I have also tried to assign it like this:

<cfset SESSION.Question#M#=evaluate("FORM.Question#M#")>

Any ideas????

-------------------------
Confucius say: All who help Newkirk will have good luck all day

Reply With Quote
  #2  
Old October 11th, 2004, 09:17 AM
Ebot's Avatar
Ebot Ebot is offline
Meatball Surgeon
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2004
Location: Elbow deep in code
Posts: 1,163 Ebot User rank is Brigadier General (60000 - 70000 Reputation Level)Ebot User rank is Brigadier General (60000 - 70000 Reputation Level)Ebot User rank is Brigadier General (60000 - 70000 Reputation Level)Ebot User rank is Brigadier General (60000 - 70000 Reputation Level)Ebot User rank is Brigadier General (60000 - 70000 Reputation Level)Ebot User rank is Brigadier General (60000 - 70000 Reputation Level)Ebot User rank is Brigadier General (60000 - 70000 Reputation Level)Ebot User rank is Brigadier General (60000 - 70000 Reputation Level)Ebot User rank is Brigadier General (60000 - 70000 Reputation Level)Ebot User rank is Brigadier General (60000 - 70000 Reputation Level)Ebot User rank is Brigadier General (60000 - 70000 Reputation Level)Ebot User rank is Brigadier General (60000 - 70000 Reputation Level)Ebot User rank is Brigadier General (60000 - 70000 Reputation Level)  Folding Points: 21785 Folding Title: Starter FolderFolding Points: 21785 Folding Title: Starter Folder
Time spent in forums: 1 Week 4 Days 3 h 34 m 39 sec
Reputation Power: 684
In your CFif, you have double quotes around your values, get rid of those.

Reply With Quote
  #3  
Old October 11th, 2004, 10:07 AM
mikemac mikemac is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: Greenville NC
Posts: 70 mikemac User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 15 m 24 sec
Reputation Power: 4
Thumbs down No difference

Quote:
Originally Posted by Ebot
In your CFif, you have double quotes around your values, get rid of those.


Thanks for the heads up but it is still a dud!!!!

Reply With Quote
  #4  
Old October 11th, 2004, 10:20 AM
kaasu kaasu is offline
Web Developer
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 58 kaasu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 1 m 4 sec
Reputation Power: 5
Try something like this for your session variable assignment

<cfset structinsert( session, 'Question' & M, form['question' & m])>

Hope it helps

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Dynamically assigning SESSION vars to form input


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway