SCJP 6
mahesh shinde wrote:why not Ajax.
if pure java then handle it using javascript
SCJP 6
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.
SCJP 6
SCJP 6
<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>
SCJP 6
SCJP 6
rubbery bacon. crispy tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|