0

How to show the content in the dropdowlist in java script, I try the code but the content not show... this the code below to how to show the content...

Dropdownlist1:

<select name="zone" onchange="this.form.submit();">
    <%
        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
        Connection connection1 = DriverManager.getConnection("jdbc:odbc:register");
        Statement statement2 = connection1.createStatement();
        ResultSet resultset2 = statement2.executeQuery("select zone from landamount");
    %>
    <option>--Select--</option>
    <% while (resultset2.next()) {%>

    <option><%= resultset2.getString(1)%>
    </option>

    <% }%>
</select>
Ashot Karakhanyan
  • 2,804
  • 3
  • 23
  • 28

1 Answers1

0

You need a Text Node between your <option> tag. Otherwise you will see a blank drop down list.

Brendan
  • 1,399
  • 1
  • 12
  • 18