JSP: input type date

Issue

This Content is from Stack Overflow. Question asked by Huraipan

I want to use alert if users doesn’t check
Date

<form action=“1.jsp” method=“post”>
<input type=“date” name=“day”>

So how Do I write in 1.jsp

I tried

String day = request.getparameter(“day”)
   if(day == null){
%>
   <script>
     Alert(“”)
    History.go(-1)

But it isn’t work
I think date’s default data is not null



Solution

Check the Answers

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?