Actually wat I need is: I have submitted some data in database from a html form. Then I have to load one column of that data in select tag of another form. I have done this but problem is that how will I increase the number of options as the number of records are increased.
Code is as follows
<%@ page import="java.util.*"%>
<%@ page import="java.lang.*"%>
<%!
ArrayList al;
Object o[];
String s[] = new String[10];
%>
<jsp:useBean id="c" class="com.ebbeans.ViewBean"/>
<jsp:setProperty name="c" property="*"/>
<%
al = c.loadExistingEmpCode();
o = al.toArray();
for (int i = 0; i < o.length; i++) {
s[i] = (String) o[i];
}
%>
..........
..........
<select name="empCode" size="1" id="empCode">
<option value="<%= s[0] %>" selected><%= s[0] %></option>
<option value="<%= s[1] %>"><%= s[1] %></option>
<option value="<%= s[2] %>"><%= s[2] %></option>
<option value="<%= s[3] %>"><%= s[3] %></option>
<option value="<%= s[4] %>"><%= s[4] %></option>
</select>
Here only 5 options will be shown. How would I increase the number of options dynamically when the records are incresed?