| Author |
ComboBox using JSP
|
adriana cardoso
Greenhorn
Joined: Sep 26, 2006
Posts: 9
|
|
Hello, Some person has ? I need one soon code using Vector to list for example a field of my called table Name and in mine jsp implements one ComboBox.I have with difficulties to add to this ComboBox listing the names my jsp. Please help me i need deliver soon. Adriana
|
Adriana
|
 |
adriana cardoso
Greenhorn
Joined: Sep 26, 2006
Posts: 9
|
|
|
please help me....
|
 |
Stefan Evans
Bartender
Joined: Jul 06, 2005
Posts: 1002
|
|
patience grasshopper. Your question has been up less than two hours. And I'm not even sure I understand the question. Where is the data coming from? What code have you already got? Which bit are you having trouble with? I can break it down into two broad sections. - Code to query database table and put results into List. (in a bean) - JSP page rendering the dropdown box. Use JSTL to loop through the list and generate an option element for each item in the list. If you are using a framework like Struts/JSF there are custom tags that can help you with that second part.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56162
|
|
|
There is no such thing as a Combo box in HTML. Do you mean a select element? (sometines called a dropdown).
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
reddy yeruva
Greenhorn
Joined: Oct 18, 2006
Posts: 18
|
|
hai.. what i understand from you question is you want to place the database values in the combobox in the jsp page yes? if yes the logic lis very simple... <SELECT class=drop style="WIDTH: 143px" name=scountry > <option selected>Select a Country</option> <option selected value=<%=test%>><%=test%></option> <% while(rs.next()) {%> st1= rs.getString("countryname").trim(); <option value="<%=st1%>"><%=st1%></option> <% } %> </SELECT>
|
Y.Tirupati Reddy<br />reddy.yeruva@gmail.com
|
 |
Marko Debac
Ranch Hand
Joined: Aug 21, 2006
Posts: 121
|
|
Hi, or you can try this: cheers
|
 |
 |
|
|
subject: ComboBox using JSP
|
|
|