Reputation: 545
I can't get the value of the form - I still get 'null'. What am I doing wrong??
<br><br>
<form method = "POST">
<label>From:</label>
<input type="date" name="inputFrom"
value="2020-01-01"
min="2000-01-01" max="2022-12-31">
</form>
<% out.println(request.getParameter("inputFrom")); %>
Upvotes: 0
Views: 324
Reputation: 101
The method POST only specifies what HTTP should be used to submit the form. It does not fire a submission. You may use a submit button to do it. Here you can see an example of how to build a minimum form and provides a submit button. In your code:
<br><br>
<form method = "POST">
<label>From:</label>
<input type="date" name="inputFrom"
value="2020-01-01"
min="2000-01-01" max="2022-12-31">
<input type="submit" value="Submit">
</form>
<% out.println(request.getParameter("inputFrom")); %>
Upvotes: 1