this did it:

<cfif IsDefined("form.fieldnames")>

 <CFLOCK
 SCOPE="session"
 TIMEOUT="30"
 TYPE="Exclusive">

 <cfif IsDefined("form.userid")>
 <cfset userid = #form.userid#>
 <cfelse>
 <cfset userid = #session.userid#>
 </cfif>

 <cfquery datasource="#dsn#">
 DELETE FROM artformjoin
 WHERE userid = #variables.userid#
 </cfquery>

 <cfset mylist = #form.artform#>
 <cfset adds = ListLen(form.artform)> // s'pose I could do ListLen(mylist)

 <cfloop from="1" to="#variables.adds#" index="id">
         <cfquery datasource="#dsn#">
         INSERT INTO artformjoin (userid, artformid) VALUES
(#variables.userid#, #ListGetAt(mylist, id)#)
         </cfquery>
    </cfloop>

 </CFLOCK>

</cfif>

it means the user has to select at least one artform - but hey, if they're
not interested in at least _one_ artform, what the hell are they doing
registering for an arts web site? ;-)

thanks for all the help.

Ian W

----- Original Message -----
From: "Stephen Moretti" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 06, 2003 4:32 PM
Subject: Re: [ cf-dev ] form.fieldnames


>
>
> > form variables were a structure in CF5 as well.
> >
> Thought so....  Wonder whether lunchtime beer and sunshine had addled my
> brain.
>
> So Ian, what's the problem?  Whats the code you've got now and what errors
> are you getting.
>
> 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]

Reply via email to