Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Pado
Behira Younes
Commits
6b71109c
Commit
6b71109c
authored
Oct 31, 2020
by
Ratnadeep Rajendra Kharade
Browse files
added missing validations and other changes
parent
b76526aa
Pipeline
#1137
passed with stages
in 11 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
public/index.html
View file @
6b71109c
...
...
@@ -54,9 +54,10 @@
<label
for=
"inputTextCharacters"
>
Enter number of characters:
</label>
<input
oninput=
"handleCharacterInputChange()"
placeholder=
"e.g. 120"
class=
"box-input"
type=
"number"
id=
"inputTextCharacters"
name=
"inputTextCharacters"
value=
""
>
<div
id=
"textCharacters-validation"
class=
"error-message"
>
Please enter number
the
of characters.
</div>
<div
id=
"textCharacters-validation"
class=
"error-message"
>
Please enter
the
number of characters.
</div>
</div>
<div
id=
"min-count-validation"
class=
"error-message"
>
Please enter minimum number the of characters.
</div>
<div
id=
"min-count-100-validation"
class=
"error-message"
>
Please enter more than 100 alphabetic characters.
</div>
<div
id=
"min-count-400-validation"
class=
"error-message"
>
Please enter more than 400 alphabetic characters.
</div>
<div
class=
"more-information"
>
<div>
<h4>
<span>
ⓘ
</span>
Note
</h4>
...
...
@@ -114,7 +115,10 @@
</div>
<div
id=
"calculate-time-element"
style=
"display: none;"
>
<div
class=
"title"
>
<h2>
Estimated Reading Time(hh:mm:ss):
<span
id=
"reading-time-element"
></span>
hours
</h2>
<h2><span><br>
Estimated Reading Time(hh:mm:ss)
<br>
<span
id=
"reading-time-element"
></span>
</span></h2>
</div>
<div>
Send your feedback on: behira.younes@univ-oran2.dz
...
...
public/index.js
View file @
6b71109c
...
...
@@ -36,6 +36,9 @@ function handleTextRadioClick() {
document
.
getElementById
(
'
textCharacters-validation
'
).
style
.
display
=
'
none
'
;
}
document
.
getElementById
(
'
min-count-100-validation
'
).
style
.
display
=
'
none
'
;
document
.
getElementById
(
'
min-count-400-validation
'
).
style
.
display
=
'
none
'
;
toggleElement
(
'
character-calculation-wrapper
'
);
toggleElement
(
'
manual-character-input
'
);
}
...
...
@@ -126,9 +129,16 @@ function isFormValid() {
if
((
inputObj
.
numberOfCharacters
<
100
&&
(
inputObj
.
schoolLevel
===
'
1
'
||
inputObj
.
schoolLevel
===
'
2
'
)))
{
invalidFields
++
;
document
.
getElementById
(
'
min-count-validation
'
).
style
.
display
=
'
block
'
;
document
.
getElementById
(
'
min-count-100-validation
'
).
style
.
display
=
'
block
'
;
}
else
{
document
.
getElementById
(
'
min-count-100-validation
'
).
style
.
display
=
'
none
'
;
}
if
((
inputObj
.
numberOfCharacters
<
400
&&
(
inputObj
.
schoolLevel
===
'
3
'
||
inputObj
.
schoolLevel
===
'
4
'
)))
{
invalidFields
++
;
document
.
getElementById
(
'
min-count-400-validation
'
).
style
.
display
=
'
block
'
;
}
else
{
document
.
getElementById
(
'
min-count-validation
'
).
style
.
display
=
'
none
'
;
document
.
getElementById
(
'
min-count-
400-
validation
'
).
style
.
display
=
'
none
'
;
}
return
invalidFields
<
1
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment