• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to get the value selected in the select tag using jsp?

 
Sandhya Deekonda
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everyone,
In my jsp i'm writing a select tag,I want to get the value .I tried using request.getParameter i'm not getting.What may be the reason??
Code as follows:
<select name="language">
<option value="Java">Java</option>
<option value="ASP.NET">ASP.NET</option>
</select>
<%=request.getParamater("language")%>

the value in the expression tag is null.Why am i getting it as null? Can anyone tell me?
Thanks,
Sandhya.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Becuase you're trying to read the parameter before you've submitted the form.
 
Sandhya Deekonda
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ben,I got it.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!