473,326 Members | 2,012 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Multiple Items Selection from a dropdown

Hi All,
Please let me know if there is way in which i we can make multiple selections from a drop down list.

The requirement is as follows:

I have a drop down list, whose entries are to be populated from a table in the database. The user should be able to select multiple items from the drop down list(Maximum 3), and on pressing the submit button, a single column in a row, in the table should be populated with all the selected values.
Kindly help.

Thank You.
May 25 '07 #1
5 1692
dip_developer
648 Expert 512MB
Hi All,
Please let me know if there is way in which i we can make multiple selections from a drop down list.

The requirement is as follows:

I have a drop down list, whose entries are to be populated from a table in the database. The user should be able to select multiple items from the drop down list(Maximum 3), and on pressing the submit button, a single column in a row, in the table should be populated with all the selected values.
Kindly help.

Thank You.
why are you using dropdown??? use listbox instead......
May 25 '07 #2
prabunewindia
199 100+
ya its better to use listbox for selecting more than one items
May 25 '07 #3
why are you using dropdown??? use listbox instead......




ok ....... even if i use list box, how do i make multiple selected entries into the database.
ehat i mean is suppose a user selects 3 items from the list, how do i make sure that all the 3 elements are inserted,(separated by a comma) into the same column in a row of the table ????

could you please send me the code or query for that???
May 25 '07 #4
ya its better to use listbox for selecting more than one items

ok ....... even if i use list box, how do i make multiple selected entries into the database.
ehat i mean is suppose a user selects 3 items from the list, how do i make sure that all the 3 elements are inserted,(separated by a comma) into the same column in a row of the table ????

could you please send me the code or query for that???
May 25 '07 #5
prabunewindia
199 100+
hi friend,

try with this one
string AllItems="";
foreach (ListItem item in ListBox1.Items)
{
if (ListBox1.Items.FindByText(item.Text).Selected == true)
{
if(AllItems=="")
{
AllItems=item.Text;
}
else
{
AllItems=AllItems+","+item.Text;
}
}
}

now you got the string as u need. store it in database

Prabu

ok ....... even if i use list box, how do i make multiple selected entries into the database.
ehat i mean is suppose a user selects 3 items from the list, how do i make sure that all the 3 elements are inserted,(separated by a comma) into the same column in a row of the table ????

could you please send me the code or query for that???
May 25 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Ringwraith | last post by:
Hi! Have anyone ever tried to modify the Gene Cash's Tkinter tree widget (available from http://home.cfl.rr.com/genecash/) so it supports multiple items selection ( selection of multiple files...
2
by: Jas | last post by:
I want an ASP page with a dropdown and a simple button. Every time the user chooses an item from the dropdown and clicks on the button i want that value written below in list and allow user to...
7
by: Felix Natter | last post by:
hi, I have a php-Script which gets passed a Boat-ID and this is used to mark an element in a <select> as the default: <select name="boote" multiple="multiple" size="5"> <option...
3
by: Disco-181 | last post by:
Hi, I have a script which isn't working in Mozilla based browser for some reason. I'm trying to run two functions from the body onload tag and it simply isn't happening. I have a cascading...
5
by: Kay | last post by:
Hello, I have two list boxes on my form, one initially displays with items and the other displays blank, by clicking a button, it is possible to move items from one box to another and vice a...
2
by: Peter | last post by:
Hello! Please, could anyone tell, is it possible to set multiple items to be selected in list control in the code? For example when the web form is loaded three items of 5 are selected in list...
10
by: ads | last post by:
hi, after binding the dropdownlist to a datasource, ive experience this error "Cannot have multiple items selected in a dropdownlist" after using the code:...
1
by: jjuan | last post by:
I have a multiple dropdown which have multiple selection. If I select multiple value on my multiple dropdown list and submit it,how can i write it on the tblotherlang sample code <select...
2
by: permander kumar | last post by:
hi plz help me, i have a code in which two multiple selection dropdown list. in first list if I am select single value the data are fetch in second table on button click. but the problem is in...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.