Click here to Skip to main content
14,299,664 members
Rate this:
Please Sign up or sign in to vote.
See more:

I have a jsp form page where created a dropdown field. Based on one of the value chosen I need to show the upload button option which is in different jsp. I tried the below code. Can someone please assist me what am missing here as the code is not showing any error and not working thou.

What I have tried:

<pre><%@ page language="java" contentType="text/html; charset=ISO-8859-1"
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
<%@ taglib uri="" prefix="c" %>


    <div align="center" style="margin-top: 50px;">

        <form action="FirstwebServlet">
            Please enter username: <input type="text" name="username" size="20px"> <br>
            Please enter your password: <input type="text" name="password" size="20px"> <br>

               <br> Please select the option: 
               <select required="required" name="sel">
                 <option value="None">Choose from the list </option>
                 <option value="Report">Report</option>
                 <option value="Template">Template</option>

               </select> <br> 
              <% String sel = request.getParameter("sel");
   if( sel != null  && sel =="Template" ) {%>
       <%@ include file="upload.jsp" %> 

  <%  }
            <input type="submit" value="submit">



This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100