Skip to content

Commit

Permalink
Add validation to make sure the input values entered are integers and…
Browse files Browse the repository at this point in the history
… format Java code
  • Loading branch information
lulunac27a committed Mar 25, 2024
1 parent 3143d1e commit ca2dcf9
Show file tree
Hide file tree
Showing 2 changed files with 254 additions and 210 deletions.
9 changes: 9 additions & 0 deletions datetime-jsp/datetime.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ <h1>Enter date and time values</h1>
type="number"
name="year"
id="year"
step="1"
required
onchange="getDaysInMonth()"
/><br />
Expand All @@ -24,6 +25,7 @@ <h1>Enter date and time values</h1>
id="month"
min="1"
max="12"
step="1"
required
onchange="getDaysInMonth()"
/><br />
Expand All @@ -34,6 +36,7 @@ <h1>Enter date and time values</h1>
id="day"
min="1"
max="31"
step="1"
required
/><br />
<label for="hour">Hour:</label><br />
Expand All @@ -43,6 +46,7 @@ <h1>Enter date and time values</h1>
id="hour"
min="0"
max="23"
step="1"
required
/><br />
<label for="minute">Minute:</label><br />
Expand All @@ -52,6 +56,7 @@ <h1>Enter date and time values</h1>
id="minute"
min="0"
max="59"
step="1"
required
/><br />
<label for="second">Second:</label><br />
Expand All @@ -61,6 +66,7 @@ <h1>Enter date and time values</h1>
id="second"
min="0"
max="59"
step="1"
required
/><br />
<label for="millisecond">Millisecond:</label><br />
Expand All @@ -70,6 +76,7 @@ <h1>Enter date and time values</h1>
id="millisecond"
min="0"
max="999"
step="1"
required
value="0"
/><br />
Expand All @@ -80,6 +87,7 @@ <h1>Enter date and time values</h1>
id="microsecond"
min="0"
max="999"
step="1"
required
value="0"
/><br />
Expand All @@ -90,6 +98,7 @@ <h1>Enter date and time values</h1>
id="nanosecond"
min="0"
max="999"
step="1"
required
value="0"
/><br />
Expand Down
Loading

0 comments on commit ca2dcf9

Please sign in to comment.