I have a jsp with two drop down location and department.
The value of department dropdown is populated based on the value of location through Ajax.
But when I try to save the page I can't access the value of department dropdown if the first item from the department drop down is selected.
But if 2nd or 3rd item is selected it can be accessed from the servlet.
Servlet
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
int intLocId = Integer.parseInt(request.getParameter("locName"));
String strDivNm = (String) request.getParameter("divName");
int intDeptId = Integer.parseInt(request.getParameter("ddDeptName"));
LocationPolulate lp = new LocationPolulate();
int Res = lp.InsertDivision(strDivNm, intLocId, intDeptId);
if (Res == 0) {
request.setAttribute("Errmsg", "Error Cannot Save Division");
RequestDispatcher dis1 = getServletContext().getRequestDispatcher("/AddDivision");
dis1.forward(request, response);
} else {
int Div = lp.DivisionId();
request.setAttribute("succmsg", "Successfully saved Division with division id:" + Div);
RequestDispatcher dis1 = getServletContext().getRequestDispatcher("AddDivision.jsp");
dis1.forward(request, response);
}
}
Any ideas?
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)