Problem displaying output from drop down loaded by sql query.

Posted on 2006-04-28
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 ( {
         <option <%=rset.getString(1) %> </option>
         <% } %>
<input type ="submit">

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.
Question by:amenoss
    LVL 14

    Accepted Solution

    The option tag is <option value="thevalue">thelabel</option>, so the code should be:

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

    Expert Comment

    or just
    <option><%=rset.getString(1) %></option>

    Author Comment

    Thanks Boonleng...

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    maven scope 1 117
    eclipse problems view not showing all the time 4 85
    grep code 4 134
    own marker interface 1 42
    This post first appeared at Oracleinaction  ( Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
    Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    728 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

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now