> Do you need instead <input type="checkbox" name="#id#"> -- at > the moment > your #Form.FormFields# variable is only going to contain one > 'artform'. You > need instead to create fields with the artforumid names. Then > if they are > checked, you will have a list to loop.
No, if more than one checkbox with the same name is checked, you receive all the contents as a list of the same name as the checkbox name. ie this: <input type="checkbox" name="myBox" value="1" checked> <input type="checkbox" name="myBox" value="2" checked> will yield one variable called form.myBox with a value of "1,2". > -----Original Message----- > From: Damian Watson [mailto:[EMAIL PROTECTED] > Sent: 06 June 2003 16:48 > To: [EMAIL PROTECTED] > Subject: Re: [ cf-dev ] form.fieldnames > > > Ian, could the problem be here: > > <cfoutput query="artforms"> > <tr> > <td>#artform#</td> > <td><input type="checkbox" name="artform" value="#id#"></td> > </tr> > </cfoutput> > > Do you need instead <input type="checkbox" name="#id#"> -- at > the moment > your #Form.FormFields# variable is only going to contain one > 'artform'. You > need instead to create fields with the artforumid names. Then > if they are > checked, you will have a list to loop. > > Hope I haven't completely misunderstood! > > d > > ----- Original Message ----- > From: "Ian Westbrook" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Friday, June 06, 2003 4:09 PM > Subject: Re: [ cf-dev ] form.fieldnames > > > > can't get any of those suggestions to work. which raises > the question - > how > > do other people do it? surely writing checkbox choices to a > db is a pretty > > common occurrence? > > > > Ian W > > > > ----- Original Message ----- > > From: "Simon Horwith" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Friday, June 06, 2003 2:01 PM > > Subject: RE: [ cf-dev ] form.fieldnames > > > > > > > BTW - I've just worked out the firewall issues I was > having at my new > > > company so I am now online. Greeting UK developers. > > > > > > ~Simon > > > > > > Simon Horwith > > > CTO, Etrilogy Ltd. > > > Member of Team Macromedia > > > Macromedia Certified Instructor > > > Certified Advanced ColdFusion MX Developer > > > Certified Flash MX Developer > > > CFDJList - List Administrator > > > http://www.how2cf.com/ > > > > > > > > > -----Original Message----- > > > From: Stephen Moretti [mailto:[EMAIL PROTECTED] > > > Sent: 06 June 2003 14:00 > > > To: [EMAIL PROTECTED] > > > Subject: Re: [ cf-dev ] form.fieldnames > > > > > > > > > Ian, > > > > > > No * required in the DELETE. > > > > > > <cfquery datasource="#dsn#"> > > > DELETE > > > FROM artformjoin > > > WHERE userid = #variables.userid# > > > </cfquery> > > > > > > > > > Use form[field] to reference the content of your form field. > > > > > > <cfquery datasource="#dsn#"> > > > INSERT INTO artformjoin (userid, artformid) VALUES > (#variables.userid#, > > > #form[field]#) > > > </cfquery> > > > > > > Be aware that form.artform will be a comma delimited list > of artform ids > > if > > > the user selects more than one artform in form. > > > > > > You probably need some this like this. > > > > > > <cfif field eq 'artform'> > > > <cfloop list="#form[field]#" index="artformid"> > > > <cfquery datasource="#dsn#"> > > > INSERT INTO artformjoin (userid, artformid) VALUES > > > (#variables.userid#, #artformid#) > > > </cfquery> > > > </cfloop> > > > </cfif> > > > > > > Stephen > > > > > > > > > > > > -- > > > ** Archive: > http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ > > > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > For human help, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > > > > > -- > > > ** Archive: > http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ > > > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > For human help, e-mail: [EMAIL PROTECTED] > > > > > > > > > -- > > ** Archive: > http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > For human help, e-mail: [EMAIL PROTECTED] > > > > > > > > -- > ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ > > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > For human help, e-mail: [EMAIL PROTECTED] > -- ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] For human help, e-mail: [EMAIL PROTECTED]
