File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -9,9 +9,9 @@ <h1>Enter date and time values</h1>
99< body >
1010< form method ="post " action ="datetime.jsp ">
1111 < label for ="year "> Year:</ label > < br >
12- < input type ="number " name ="year " id ="year " required > < br >
12+ < input type ="number " name ="year " id ="year " required onchange =" getDaysInMonth() " > < br >
1313 < label for ="month "> Month:</ label > < br >
14- < input type ="number " name ="month " id ="month " min ="1 " max ="12 " required > < br >
14+ < input type ="number " name ="month " id ="month " min ="1 " max ="12 " required onchange =" getDaysInMonth() " > < br >
1515 < label for ="day "> Day:</ label > < br >
1616 < input type ="number " name ="day " id ="day " min ="1 " max ="31 " required > < br >
1717 < label for ="hour "> Hour:</ label > < br >
Original file line number Diff line number Diff line change @@ -44,4 +44,7 @@ function setCurrentUtcDate() {
4444 millisecond . value = currentUtcMillisecond ;
4545 microsecond . value = 0 ;
4646 nanosecond . value = 0 ;
47+ }
48+ function getDaysInMonth ( ) {
49+ day . max = new Date ( year . value , month . value , 0 ) . getDate ( ) ;
4750}
You can’t perform that action at this time.
0 commit comments