?
Solved

Problem displaying output from drop down loaded by sql query.

Posted on 2006-04-28
3
Medium Priority
?
138 Views
Last Modified: 2010-04-01
I'm having a problem getting my dropdown to display right when I try to "load" it with values from sql query (oracle).    I say its in the display becuase it kind of works.

<FORM Action="results.jsp">
        <select name="drop" size="1" >                 
        <% while (rset.next()) {
          %>
         <option <%=rset.getString(1) %> </option>
         <% } %>
         </select>
<input type ="submit">
 </FORM>

When I run the page I get the drop down very very small in size. If I click it will drop down, I can make selections and submit it works fine (aside from the fact I cant see what I selected).  To test some more I put in an option  ... <option testtest  in above the while (the fields it will be displaying are 8 characters) that makes the box open up so I can see it, but what is so weird is that the drop down selections are blank but there....The drop down will have about 325 selections in which are there but there names are blank.  If I click a selection and  submit the pages posts fine, but I have no idea what is selected. There is alphabetical order so I know they are there...just gotta get the names to display.
0
Comment
Question by:amenoss
  • 2
3 Comments
 
LVL 14

Accepted Solution

by:
boonleng earned 300 total points
ID: 16567357
The option tag is <option value="thevalue">thelabel</option>, so the code should be:

<option value="<%=rset.getString(1) %>"><%=rset.getString(1) %></option>
0
 
LVL 14

Expert Comment

by:boonleng
ID: 16567366
or just
<option><%=rset.getString(1) %></option>
0
 

Author Comment

by:amenoss
ID: 16570662
Thanks Boonleng...
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Often times it's very very easy to extend a volume on a Linux instance in AWS, but impossible to shrink it. I wanted to contribute to the experts-exchange community a way of providing a procedure that works on an AWS instance. It can also be used on…
Last month Marc Laliberte, WatchGuard’s Senior Threat Analyst, contributed reviewed the three major email authentication anti-phishing technology standards: SPF, DKIM, and DMARC. Learn more in part 2 of the series originally posted in Cyber Defense …
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question