New records. See code below. I need to parse through the submitted fields to insert them.
I think I am making it much harder then what it is but I'm SO stuck. Here's the code that I am working with to process the form fields: <cfif isDefined("form.submit")> <cfloop From="1" To= "#users.recordcount#" index="i"> <cfloop item="fname" collection="#form#"> <cfoutput><cfif #form[fname]# NEQ "">#Evaluate("form[fname]" & i)#<br /></cfif></cfoutput> </cfloop> </cfloop> </cfif> Here's the form <cfloop query="users"> <cfif users.roleID NEQ 1> <tr> <td><input name="userID#userID#" type="checkbox" value="#users.employeeID#"> #users.firstname# #users.lastname#</td> <td> <CFSELECT NAME="code#userID#"> <OPTION value=""></option> <OPTION value="Personal">Personal</option> <OPTION value="Preceptor">Preceptor</option> <OPTION value="Senior Resource Nurse">Senior Resource Nurse</option> <OPTION value="Special Project-Phone">Special Project-Phone</option> <OPTION value="System Down Time">System Down Time</option> <OPTION value="Training-In Person">Training-In Person</option> <OPTION value="Training: Phone">Training: Phone</option> <OPTION value="Client Training Phone">Client Training Phone</option> <OPTION value="Peer To Peer Consultation">Peer To Peer Consultation</option> <OPTION value="Gone Home">Gone Home</option> </CFSELECT> </td> <td><input name="minutes#userID#" value="" size="5"></td> </tr> </cfif> </cfloop> On Fri, Jan 28, 2011 at 1:43 PM, Carl Von Stetten <vonner.li...@vonner.net>wrote: > > Some more information might be helpful. Can we see the code of the form > itself? Also, are you just inserting new records into your database, or > editing existing records? > > On 1/28/2011 10:34 AM, Monique Boea wrote: > > Any sample code for a grid-like form? > > > > > > > > On Thu, Jan 27, 2011 at 8:16 PM, Monique Boea<moniqueb...@gmail.com> > wrote: > > > >> Hello All > >> > >> I have a form which is design like an excel spreadsheet with about 60 > input > >> rows. > >> > >> The user may enter values for some and not the others. > >> > >> I am stuck on entering the values into the database. > >> > >> I use the following code to loop through the forms vars but don't know > >> where to go after this. > >> > >> <cfloop list="#StructKeyList(form)#" index="key"> > >> <cfif #form[key]# NEQ "Submit" AND #form[key]# NEQ "FIELDNAMES"> > >> <cfoutput>#key# = #form[key]#<br></cfoutput> > >> </cfif> > >> </cfloop> > >> > >> > >> Any suggestions? > >> > >> P.S. Thank you guys for all of your help. It is appreciated. > >> > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:341643 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm