Post the codes you have used for the combo and for retrieving the value.
Form1:
Filter by Status: <select name="stat" >
- <%!
-
Connection con=null;
-
Statement st=null;
-
ResultSet rs=null;
-
%>
-
[HTML] <%
String statusname=null;
try
{
con=DbUtil.getConnection();
st=con.createStatement();
try
{
String query="select * from status";
rs=st.executeQuery(query);
}
catch(Exception e)
{
System.out.println(e);
}
while(rs.next())
{
statusname=rs.getString("statusname");
//System.out.println(statusname);
%>
<option value=<%=statusname%>><%=statusname%></option>
<%
}
con.commit();
}
catch(Exception e1)
{
System.out.println(e1);
}
finally
{
rs.close();
st.close();
}
%>
</select>
<input type=submit value="Go!" onFocus = "statvalidation(this.form)">
[/HTML]
in form1 i am retrieving these values from database, the options being a,b,c,d
Form2:
in form 2 i have the same code repeated, but if he selects 'c' in form1, and clicks button go, the dropdown box in form2 should have 'c' as its selected option, but by default it is showing as 'a', as i am retrieving from database....