Hi, How do you loop an input from a dropdown list ?
I have a form that has 5 fields for FNAME, 5 for LNAME and 5 dropdown list for year... all this is getting sent at once.
How do I insert this in my database ???
THIS IS WHAT MY CODE LOOKS LIKE AT ITS GIVING ME AN ERROR:
THIS IS THE CODE FOR THE INSERT/ACTION PAGE:
<CFLOOP from=1 to=5 index="loopcount">
<CFSET currF="fname#loopcount#">
<CFSET currL="lname#loopcount#">
<CFSET currY="year#loopcount#">
<Cfquery name="addjcode" datasource="Timesheets">
INSERT testdata (Year, Fname, Lname)
VALUES('#evaluate(currY)#', '#evaluate(currF)#', '#evaluate(currL)#')
</cfquery>
</CFLOOP>
I have a form that has 5 fields for FNAME, 5 for LNAME and 5 dropdown list for year... all this is getting sent at once.
How do I insert this in my database ???
THIS IS WHAT MY CODE LOOKS LIKE AT ITS GIVING ME AN ERROR:
THIS IS THE CODE FOR THE INSERT/ACTION PAGE:
<CFLOOP from=1 to=5 index="loopcount">
<CFSET currF="fname#loopcount#">
<CFSET currL="lname#loopcount#">
<CFSET currY="year#loopcount#">
<Cfquery name="addjcode" datasource="Timesheets">
INSERT testdata (Year, Fname, Lname)
VALUES('#evaluate(currY)#', '#evaluate(currF)#', '#evaluate(currL)#')
</cfquery>
</CFLOOP>