Link to home
Start Free TrialLog in
Avatar of shragi
shragiFlag for India

asked on

hidden fields in jsp

<form method="post">

<select name ="getselected" id="getselected">
<option>fox</option>
<option>fox2</option>
<option>fox3</option>
</selected>

<input type="hidden" name="hidden" value="<%=getselected%>">

</form>




on server side

String selectedvalue = (String)request.getParameter("hidden");



when i use hidden field in jsp it showed me an error

Multiple annotations found at this line:
      - Tag (input) should be an empty-
       element tag.
      - getselected cannot be resolved to a
       variable
Avatar of Sathish David  Kumar N
Sathish David Kumar N
Flag of India image

while loading the page <%=getselected%> is null so that only its give error more over you cant get that value directly .

try this

String selectedvalue = (String)request.getParameter("getselected");
ASKER CERTIFIED SOLUTION
Avatar of rrz
rrz
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial