|
|
Question : How to use CFQUERY and CFSELECT multiple selection together?
|
|
I am trying to do a form where you can select certain employees involved in a project. I can successfully pass these employees to the next page where their names are displayed, "name1, name2" like that.
------------------------- But, I cannot use names in my table. They must be ID numbers. I can convert the names to numbers ONLY if only one employee is selected from the previous page. When I have more than one, nothing happens.
SELECT UserID FROM check WHERE name='#FORM.Involvement#'
The code above is how I convert them. How do I get it so that I can output the numbers AND pass these numbers to another page so I can insert them into a table?
Also, after passing these numbers, how do you insert these multiple numbers? Do I use a loop or is there an automatic piece of code to use. How do I calculate the number of names that were selected?
Thanks for your time. I truly appreciate it!
|
Answer : How to use CFQUERY and CFSELECT multiple selection together?
|
|
Here is what you need:
-----------------------------
select UserID, Name from check
----------------------------- Note that VALUE should contain UserID and DISPLAY - Name.
Now how you would retrieve selected rows:
----------------------------- SELECT UserID, Name FROM check WHERE UserID in (#form.Involvement#)
----------------------------- That's it.
|
|
|
|
|