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

Item in Listbox to display content in another listbox

9
Developement platform : Linux
I'm using cgi.

I have 2 listbox (<select>) on the same page.
the first listbox will display all the item name(flat file) from a directory.
the second listbox will then display the content of the selected items in first listbox to the second listbox once the item in first listbox is clicked or selected.

below are my first listbox. i have no idea if that is correct or not.
Expand|Select|Wrap|Line Numbers
  1. @testList = `ls -1 /u/test/html/cgi-bin/tester/List`;
  2.  
  3.  
  4. print"<select multiple=\"multiple\">";
  5. for(@testList){
  6. $tester = $_; 
  7. print"<option>$tester</option>";
  8. }
  9. print"</select>";

Pls advice and guide me through this. Thanks a lot
May 11 '11 #1
1 1709
acoder
16,027 Expert Mod 8TB
Add an onchange to the first listbox which calls a JavaScript function which would get all the selected options (opt.selected where opt is an option and selected is a property true/false).

Use a for loop to loop over the options. To add options to the second listbox, you can use new Option(...) or the select add() method.

This should be enough to get you started. If you get stuck, post your updated code.
May 12 '11 #2

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

Similar topics

1
by: Seth Delaney | last post by:
I have a form with a combobox and a list box. The combobox will list records (names of queries) that are entered in a table called tblListName. I have the combobox set to get its values from this...
4
by: Hardy Wang | last post by:
Hi I have a ListBox control in my ASP.NET page. After I binding data to this control, I would like to be able to change this display order of items in this control. Just like change layout...
0
by: DC Gringo | last post by:
Can someone guide me to a resource on building set of drill-down listboxes? Basically I want to have 4 listboxes. The first starts out with several options, clicking on one (or more with CTL key...
3
by: Chris Kettenbach | last post by:
Hello all, Quick question. I have a listbox that is populated by items from a database. When the user select something from the list, I want to populate another listbox based on the selection in...
1
by: eric | last post by:
Hi, Can anyone please explain to me how I can cop selected items from a multi listbox(simple) to another multi listbox? the code I found on msdn only seems to support single column copies, i...
3
by: perrycheung221 | last post by:
Hi guys, I got 2 listboxes in a window form, one on left and one on right. The 1st listbox have some items while the 2nd listbox is empty. Also there are 2 buttons between the 2 listboxes which...
1
by: SuriAug05 | last post by:
Hello, I have created one web page. In that i have used two listboxes. Now i want to drag an item from one listbox and drop the same item in another listbox. And also want to rearange the items...
2
vikas251074
by: vikas251074 | last post by:
I am creating an application for official use. This application will be used by employees to take items for official use. I have a list, presently this list contains three items - 1) Cartridges, ...
2
by: vinod allapu | last post by:
hi all, i am trying to generate a report, iam using sql server 2000 and Asp.net 2.0. First to select the columns iam using the list box... as we can order by the query result from the...
1
by: chez | last post by:
Developement platform : Linux I'm using cgi. I have 2 listbox (<select>) on the same page. the first listbox will display all the item name(flat file) from a directory. the second listbox will...
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...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.