I have a form which returns several different values..
some values go into 1 table, others go into others.

Here's a dump of some of the form fields
HS_1 [empty string]
HS_2 [empty string]
HS_3 [empty string]
HS_4 [empty string]
HS_5 [empty string]

these should go into the Handset table

and these which are answers to questions
QID_1     0
QID_100 0
QID_101 1
QID_102 0
QID_103 1
QID_104 0
QID_105 1
QID_106 0
QID_107 1
QID_108 0
QID_109 1
QID_110 0

and these which are comments to the questions
CID_1     [empty string]
CID_100 [empty string]
CID_101 [empty string]
CID_102 [empty string]
CID_103 [empty string]
CID_104 [empty string]
CID_105 [empty string]
CID_106 [empty string]
CID_107 [empty string]
CID_108 [empty string]
CID_109 [empty string]
CID_110 [empty string]

How do I get this info into the tables?
On another form I use...
<CFLOOP LIST="#form.fieldnames#" Index="field">
<cfif find("_",field)>
<cfset qid = mid(field,find("_",field)+1,9)>

</cfif>
</CFLOOP>

however this wont work..
How would this be modified to first insert into the Handset info and
then to insert the answers with the comments into the scores table?

Something like...

<CFLOOP LIST="#form.fieldnames#" Index="field">
<cfif find("hs_",field)>
<cfset hsid = mid(field,find("hs_",field)+1,9)>
                      .....CODE TO INSERT HANDSET INFO HERE

<cfelse>
                               <cfset qid = mid(field,find("qid_",field)+1,9)>
                       .....CODE TO INSERT SCORE INFO HERE
                </cfif>
</CFLOOP>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to