
hai,
i have static dropdown list.. i want to get the selected value in string variable without jsp
regards asha

select.jsp:
<form method="post" action="select.jsp">
<select name="sel">
<option value="Alto">Alto</option>
<option value="Esteem">Esteem</option>
<option value="Honda City">Honda City</option>
<option value="Chevrolet">Chevrolet</option>
</select>
<br>
<input type="Submit" value="Submit">
</form>
<%
String st=request.getParameter("sel");
if(st!=null){
out.println("You have selected: "+st);
}
%>

String st = request.getSelectedIndex("sel");
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.