aherlambang
aherlambang

Reputation: 14418

getting value from drop down list in JSP

How can I get a value of a drop down list in JSP and store it through session?

Upvotes: 2

Views: 10341

Answers (1)

Jigar Joshi
Jigar Joshi

Reputation: 240996

HTML

Note: note here name attribute of combobox is specified

   <select name="comboOne" >
      <option>Small0</option>
      <option>Small1</option>
      <option>Small2</option>
   </select>
   <input type="submit"/>

</form>  

JSP / SERVLET

request.getParameter("comboOne");//this will return selected value  

I would suggest to go for JSTL approch.

Upvotes: 5

Related Questions