Bear Bibeault wrote:Please take the time to choose an appropriate forum for your posts. This forum is for questions on JSP. For more information, please click this link ⇒ CarefullyChooseOneForum.
This post has been moved to a more appropriate forum.
<form method = "POST" action = "Regester.do">
<select name="mydropdown1" onChange="location.href='Regester.jsp?option='+this.value">
<%@ page import= "java.util.*" %>
<%@ page import= "country.*" %>
<%
Countries countryBean = new Countries();
for (String s: countryBean.getCountries())
{
if(request.getParameter("option") != null && request.getParameter("option").equals(s))
out.println("<option value="+s+" selected=\"selected\">"+s+"</option>");
else
out.println("<option value="+s+">"+s+"</option>");
}
%>
</select>
<select name="mydropdown2">
<%
City cityBean = new City(request.getParameter("option"));
for(String s : cityBean.getCities())
out.println("<option value="+s+">"+s+"</option>");
%>
</select>
<input type ="SUBMIT">
</form>
Chetan Dorle wrote:Try Ajax you just need to search Ajax code which calls the Database from your jsp and without refresh,
or use simple onchange() and refresh the page with new data in another dropdown.
mahesh shinde wrote:why not Ajax.
if pure java then handle it using javascript