Issue
I'm trying to get the value you select in a drop Down list in html into my servlet. I have created the drop Down list in html like this showed under here:
http://jsfiddle.net/pixeldk/TFPX2/3/
What should i write in my servlet, to request the value from the drop Down?
Normally i do it like:
String Name = request.getParameter("name");
I want to get the value you select in the drop Down, into my servlet.
String food = request.getParameter("???")
Solution
You should create a name for Select option.
<select name="food">
<option value="none">Please Select fav food</option>
<option value="Salt">Pizza</option>
<option value="Clorid">Lasagne</option>
</select>
and call it in your servlet program.
String food = request.getParameter("food")
Answered By - Nithyanandhan M
Answer Checked By - Timothy Miller (JavaFixing Admin)