Reputation: 16405
I have something like this in HTML:
<select name="selection">
<option id="1">First Option</option>
...
</select>
I would like to get the ID of the selected option in JSP. request.getParameter("selection") gives me the text of the option but I want the id.
Upvotes: 0
Views: 3501
Reputation: 14887
Keeping id
and value
same will work for you.
e.g.
<option id="1" value="1">First Option</option>
Upvotes: 2