Reputation: 267
I have one input field that is hidden. I'm using it as a placeholder to send the value to a scriptlet. Like below, but the value of the hidden field is always null. When I remove the hidden tag everything works correctly.
<form method=post action="test.jsp">
<input type="hidden" name="name" id="name" >
<button class="button primary" type="submit">Submit</button></form>
Then in scriplet getting the value, but it is nullpointer exception
<%
String x = null;
x = request.getParameter("name");
%>
Upvotes: 0
Views: 2655
Reputation: 49
It should come, only disabled fields data u will not getting in req.getParameters()
u missed value attribute
Upvotes: 0