Skip to content

Commit ca2dcf9

Browse files
committed
Add validation to make sure the input values entered are integers and format Java code
1 parent 3143d1e commit ca2dcf9

File tree

2 files changed

+254
-210
lines changed

2 files changed

+254
-210
lines changed

datetime-jsp/datetime.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ <h1>Enter date and time values</h1>
1414
type="number"
1515
name="year"
1616
id="year"
17+
step="1"
1718
required
1819
onchange="getDaysInMonth()"
1920
/><br />
@@ -24,6 +25,7 @@ <h1>Enter date and time values</h1>
2425
id="month"
2526
min="1"
2627
max="12"
28+
step="1"
2729
required
2830
onchange="getDaysInMonth()"
2931
/><br />
@@ -34,6 +36,7 @@ <h1>Enter date and time values</h1>
3436
id="day"
3537
min="1"
3638
max="31"
39+
step="1"
3740
required
3841
/><br />
3942
<label for="hour">Hour:</label><br />
@@ -43,6 +46,7 @@ <h1>Enter date and time values</h1>
4346
id="hour"
4447
min="0"
4548
max="23"
49+
step="1"
4650
required
4751
/><br />
4852
<label for="minute">Minute:</label><br />
@@ -52,6 +56,7 @@ <h1>Enter date and time values</h1>
5256
id="minute"
5357
min="0"
5458
max="59"
59+
step="1"
5560
required
5661
/><br />
5762
<label for="second">Second:</label><br />
@@ -61,6 +66,7 @@ <h1>Enter date and time values</h1>
6166
id="second"
6267
min="0"
6368
max="59"
69+
step="1"
6470
required
6571
/><br />
6672
<label for="millisecond">Millisecond:</label><br />
@@ -70,6 +76,7 @@ <h1>Enter date and time values</h1>
7076
id="millisecond"
7177
min="0"
7278
max="999"
79+
step="1"
7380
required
7481
value="0"
7582
/><br />
@@ -80,6 +87,7 @@ <h1>Enter date and time values</h1>
8087
id="microsecond"
8188
min="0"
8289
max="999"
90+
step="1"
8391
required
8492
value="0"
8593
/><br />
@@ -90,6 +98,7 @@ <h1>Enter date and time values</h1>
9098
id="nanosecond"
9199
min="0"
92100
max="999"
101+
step="1"
93102
required
94103
value="0"
95104
/><br />

0 commit comments

Comments
 (0)