| | |
Multiple Select List Handling
Please support our JSP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: May 2006
Posts: 1
Reputation:
Solved Threads: 0
On Page One of my application, I have a dropdown list that populated by a SQL query. The list displays the "Text" of the items on the list, but the values (that will be passed are the indexes from the database table) .
The user can select multiple items from the list which is then passed to Page Two, where I want to display the "Text" of the item(s) selected.
The issue is, that the selected value(s) from the list is/are the index number of the selected item.... (e.g. 1 = Item1, 2=Item2, 3=Item3) so that the results of the selection would most probably be passing (1,2,3).
To display the text, I would think that I would have to create a method that would iterate through an (Array?) and execute a SQL statement or statments that would retrieve the appropriate "Text" for the submitted values, from the database table.
I am certain that I am not the first to do this... is there any code examples that anyone would be willing to share... or are there other questions.... Would appreciate any or all help !
Thanks !!!
The user can select multiple items from the list which is then passed to Page Two, where I want to display the "Text" of the item(s) selected.
The issue is, that the selected value(s) from the list is/are the index number of the selected item.... (e.g. 1 = Item1, 2=Item2, 3=Item3) so that the results of the selection would most probably be passing (1,2,3).
To display the text, I would think that I would have to create a method that would iterate through an (Array?) and execute a SQL statement or statments that would retrieve the appropriate "Text" for the submitted values, from the database table.
I am certain that I am not the first to do this... is there any code examples that anyone would be willing to share... or are there other questions.... Would appreciate any or all help !
Thanks !!!
•
•
Join Date: Mar 2007
Posts: 83
Reputation:
Solved Threads: 2
I know this is an old question, but I just saw this, an in case anyone else wonders, I did domething like this several years ago, but rather than querying the db from page2, I made my values contain BOTH the index from the DB and the text... I just broke the strings up on page 2 to use the text for display and the index numbers later, or behind the scenes in the code...
This saves the overhead of going back to the DB to find the text yet again...
This saves the overhead of going back to the DB to find the text yet again...
•
•
•
•
On Page One of my application, I have a dropdown list that populated by a SQL query. The list displays the "Text" of the items on the list, but the values (that will be passed are the indexes from the database table) .
The user can select multiple items from the list which is then passed to Page Two, where I want to display the "Text" of the item(s) selected.
The issue is, that the selected value(s) from the list is/are the index number of the selected item.... (e.g. 1 = Item1, 2=Item2, 3=Item3) so that the results of the selection would most probably be passing (1,2,3).
To display the text, I would think that I would have to create a method that would iterate through an (Array?) and execute a SQL statement or statments that would retrieve the appropriate "Text" for the submitted values, from the database table.
I am certain that I am not the first to do this... is there any code examples that anyone would be willing to share... or are there other questions.... Would appreciate any or all help !
Thanks !!!
![]() |
Similar Threads
- collecting $_POST from a multiple select (PHP)
- <select> options selection on mouse over (JavaScript / DHTML / AJAX)
- How do I populate multiple column list box? (Visual Basic 4 / 5 / 6)
- Manipulating a list to generate multiple lists (Python)
- windows 2000 IE 6. need help to remove spyware (Viruses, Spyware and other Nasties)
- System Config. Utility (Windows NT / 2000 / XP)
- select statemt LIKE (MySQL)
- javascript to add select button (JavaScript / DHTML / AJAX)
Other Threads in the JSP Forum
- Previous Thread: how to use jsp and tomcat
- Next Thread: how to get to next record on click of a button
| Thread Tools | Search this Thread |
apache backbutton combobox connection database development directorystructure dynamicpagetitles eclipse frames glassfish imagetodatabse imageupload integer internet java javaee javascript jsf jsp jsppagetitles levels mvc2 mvcmodel2 network parameters passing ping printinserverinsteadofclient redirect request.getparameter response servlet servletdopost()readxml sessions software ssl state_saving_method stocks sun tomcat tutorial update video web





