473,411 Members | 1,937 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,411 software developers and data experts.

multiple selection using combobox

12
hi,
I have a combo-box, in which ive set its MULTIPLE attribute.
But, as i select an option i want it to appear in a textbox,comma-separated.
How can i acheive that?
May 14 '07 #1
1 3907
iam_clint
1,208 Expert 1GB
Example provided below.
Expand|Select|Wrap|Line Numbers
  1. <script>
  2. var i = 0;
  3. function Delim(){
  4.    var obj = document.getElementById("sel1");
  5.    var opts = obj.options;
  6.    var sVal = "";
  7.    var tVal = "";
  8.    for (i=0; i<opts.length; i++)   {
  9.     if (opts[i].selected == true) { sVal += opts[i].innerHTML+","; tVal += opts[i].value+","; }
  10.    }
  11.   var text1 = document.getElementById("sVal");
  12.   var text2 = document.getElementById("tVal");
  13.   text1.value = sVal;
  14.   text2.value = tVal;
  15. }
  16. function wait() {
  17.  window.setTimeout("Delim()", "100");
  18. }
  19. </script>
  20. <input type="text" id="sVal"><input type="text" id="tVal">
  21. <br>
  22. <select name="sel1" id="sel1" onclick="wait();" style="width: 310px;" multiple>
  23. <option value="1">blah</option>
  24. <option value="2">blah1</option>
  25. <option value="3">blah2</option>
  26. <option value="4">blah3</option>
  27. <option value="5">blah4</option>
  28. <option value="6">blah5</option>
  29. <option value="7">blah6</option>
  30. <option value="8">blah7</option>
  31. <option value="9">blah8</option>
  32. <option value="10">blah9</option>
  33. <option value="11">blah10</option>
  34. <option value="12">blah11</option>
  35. <option value="13">blah12</option>
  36. <option value="14">blah13</option>
  37. <option value="15">blah14</option>
  38. <option value="16">blah15</option>
  39. <option value="17">blah16</option>
  40. <option value="18">blah17</option>
  41. <option value="19">blah18</option>
  42. <option value="20">blah19</option>
  43. <select>
  44.  
May 14 '07 #2

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

Similar topics

1
by: Steve | last post by:
I have a continuous form with several unbound comboboxes in the form header. The comboboxes are used to provide criteria for the SQL of the form. The code behind the form looks like: Public Sub...
0
by: dbuchanan | last post by:
How do I make multiple DataGridTableStyles serve the same table? (I can get multiple styles for the same datagrid, but not multple styles for the same *table* on the same datagrid) I want to do...
5
by: Keith G | last post by:
I am using Visual Studio 2003. In the standard combobox control it would appear that only 1 column of data can be displayed in the list (as stipulated in the DisplayMember property). In VBA it was...
5
by: njb35 | last post by:
Hi all I'm beginning my foray from VBA into VB 2005 Express, and enjoying some of the efficiencies it provides! I'm stuck with some dataset handling however that I _think_ can be automated but...
4
by: tbayse | last post by:
Hello, I have a question about making multiple selection queries in Access. I am running windows XP and Access 2003. Up until this point I had a form where a user would make single selections from...
0
by: jimmarq | last post by:
I am creating a windows form application in VB.NET 2.0. I have a datagridview, and one of the columns ("SelectorColumn") is a Combobox. The combobox values come from a dataset, and the column is...
1
by: BSTAFFORD | last post by:
I need help. I have a form with a 5 comboboxes. the form also contains a subform query with the saved records from those 5 combobox categories. What I'd like to happen is as a new record is...
2
by: billa856 | last post by:
Hi, My Project is in MS Access. In that I have one form in which I have some textboxes,comboboxes and listboxes. Now when I select value from 1st combobox(CustomerID) then it wil generate list for...
0
by: Germaris | last post by:
Hi there! Is it possible to make multiple selections in a ComboBox ? i.e. make n consecutive selections and store them in an array or make n selections in the open list of the CB by using (for...
12
by: micarl | last post by:
How would i print a report based on criteria selected from several Combo Boxes as well as multiple Multi Select List Boxes, that are located on the same form? I can get one Multi List Box, just...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.