Ask a Question related to Dreamweaver AppDev, Design and Development.
-
greekchild #1
Multi Select List box
Hi, I'm hoping someone can help. I have a dynamic multiselect menu. When a
user selects more than one of the options, I am trying to pass in the multiple
values into a recordset variable. I can pass in a normal dropdown listbox as
a variable but how do I use multiple values in a where statement. select *
from user where user_id in ('Parameter') Any help is much appreciated. Thanks
Con
greekchild Guest
-
List Component - Multi-select retrieve data
Hey there, I'm having trouble retrieving the value of a multi-select list component. It always traces the last value selected, but I need to... -
multi table select
I have two tables - table1 and table2. Their structures are identical and contain a column called status (an integer to store http response status... -
Multi-line TextBox - Paste text with numbered list, bullet list, tab character
Hi All, I need a server control that's exactly like a multi-line TextBox, but also allow users to paste text with numbered list, bullet list, and... -
Select a list of items into an aliased field when doinga select
OK I know this is going to sound weird, but I'm wondering if this is possible. I have a task table. (tblTask) These tasks can be assigned to... -
multi-select box validation
Hi folks. I'm porting a cf site to php, everything's going very well, I like php much better (this, of course, being the correct forum to make... -
Chris In Madison #2
Re: Multi Select List box
Are the values you are passing numeric or text-based?
Best regards,
Chris
Chris In Madison Guest
-
greekchild #3
Re: Multi Select List box
Hi Chris,
The values I am passing are numeric. The menu list value is an id and the lable is text.
Thanks
Con
greekchild Guest
-
Chris In Madison #4
Re: Multi Select List box
Then this should be pretty easy. Not sure which server model you're using,
but I'm going to do this in ASP in this example.
When you create your recordset definition, create a parameter with any name
you like ("intUserList" for example). Then, for the default value, use -1
or something you know won't return any values, and for the Run-Time Value,
use Request("name_of_list_box").
For your query use:
select * from user where user_id in (intUserList)
Dreamweaver should fix up the query so the resultant code will look like
this:
"select * from user where user_id in (" +
Replace(Request("name_of_list_box"), "'", "''") + ")"
So, if you select only one item in your list box, the resultant SQL would be
(for example)::
select * from user where user_id in (2)
And if you select more than one item, the resultant SQL would be (for
example):
select * from user where user_id in (2, 4, 6, 8)
That should do the trick (hopefully!)
Best regards,
Chris
Chris In Madison Guest
-
greekchild #5
Re: Multi Select List box
Hi, Thanks for the reponse but unfortunately it didn't work. Request('listbox')
won't work so I tried request.form('listbox') and
request.querystring('listbox') It only does the sql statement with the first
option you select in the listbox. e.g if you select 3 items it still only adds
1 in the sql statement. Cheers
greekchild Guest
-
Chris In Madison #6
Re: Multi Select List box
really? That's weird...
Let me do some tests and I'll get back with you...
~Chris
Chris In Madison Guest



Reply With Quote

