> I have a form that displays multiple records populated from
> the database.  Something like this:
>
> Department
>     EmployeeName      Add1(text input)   Add2(text input)
> City (text input)
>     EmployeeName      Add1(text input)   Add2(text input)
> City (text input)
>     .
>     .
> Department
>     EmployeeName      Add1(text input)   Add2(text input)
> City (text input)
>     EmployeeName      Add1(text input)   Add2(text input)
> City (text input)
>     .
>     .
> etc.
>
> The question is how to I process this?  It passes multiple
> EmployeeID's (from hidden field), but only the text input
> fields if they are populated (they aren't required).
>
> I think I've done it before, but I'm brain dead today.

Name the text fields in relation to the EmployeeID, so
EmployeeName_1, Add1_1, Add2_1
EmployeeName_5, Add1_5, Add2_5

Then loop through the EmployeeIDs doing updates on those records with
those fields

<cfloop index="I" list="#form.EmployeeID#">
        update EmployeeInfo
        set EmployeeName='#Form["EmployeeName_" & i]#',
                Add1='#Form["Add1_" & i]#',
                Add2='#Form["Add2_" & i]#'
        where EmployeeID=#i#
        ;
</cfloop>

Philip Arnold
Technical Director
Certified ColdFusion Developer
ASP Multimedia Limited
Switchboard: +44 (0)20 8680 8099
Fax: +44 (0)20 8686 7911

www.aspmedia.co.uk
www.aspevents.net

An ISO9001 registered company.

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************


______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to