Gel,
If you use checkboxes (which is the best way BTW) they will be passed to the
next page upon form submission as a comma separated list, which is perfect
for CF, since this is a standard CF List Format...
SO, what you will do is query your database of employees with some code like
the following:
<CFQUERY NAME="GetEmployees" DATASOURCE="#ODBC_DATASOURCE#">
SELECT *
FROM Employees
WHERE
<CFLOOP INDEX="x" FROM="1" TO="#ListLen(employees)#">
<CFIF #X# EQ #ListLen(employees)#>
employeeid = #ListGetAt(employees,x)#
<CFELSE>
employeeid = #ListGetAt(employees,x)# OR
</CFIF>
</CFLOOP>
</CFQUERY>
<!-- note: employees would be the name of the checkbox control on the
previous page --->
That will return a recordset of all the selected checkboxes...
Some things you could/should do...
- Use the CFLOOP for looping over lists, but I think for show purposes the
above code shows what needs to be done better
- error check to make sure that at least one checkbox was selected
- maybe limit to 20 per page and do some paging (if page download size is an
issue)
- dynamically create the variable names for each employee for later
update...
Anyway, there are probably other ways, but this method will work...
HTH,
John
-----Original Message-----
From: Angél Stewart [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 05, 2000 10:08 AM
To: [EMAIL PROTECTED]
Subject: How do I read a list of employee IDs returned from a form,with
checkboxes??
Hi folkses!
G morning to you all :)
A client wants me to return a list of Employees by Department, which may
result in about 100 or so rows in a simple table.
He wants to click a checkbox / radio button to select say..20 employees that
she wants to edit.
(This can be anything else beside a checkbox..doesn't matter)
I need a way to then pull the Employee ID for these checked records, in
order to display them in a table on a followup page for editing.
How am I going to get these employee IDs to be passed to the next page when
she submits the form?
I'm stumped :-(
Oh..btw. My deadline for this is tomorrow morning.
wheee!
-Gel
----------------------------------------------------------------------------
--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.