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
210ed922
Commit
210ed922
authored
Oct 30, 2020
by
Ratnadeep Rajendra Kharade
Browse files
added validation for minimum number of characters
parent
10419a27
Pipeline
#1132
passed with stages
in 11 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
public/index.js
View file @
210ed922
...
...
@@ -12,6 +12,15 @@ let inputObj = {
function
handleTextRadioClick
()
{
let
textChoice
=
document
.
querySelector
(
'
input[name="text-input-option"]:checked
'
).
value
;
inputObj
.
textChoice
=
textChoice
;
if
(
textChoice
===
'
manual
'
)
{
let
value
=
removeSpecialCharacters
(
inputObj
.
text
);
let
characters
=
value
.
length
;
setCharacterLength
(
characters
);
}
else
{
let
value
=
document
.
getElementById
(
"
inputTextCharacters
"
).
value
;
setCharacterLength
(
value
);
}
isFormValid
();
toggleElement
(
'
character-calculation-wrapper
'
);
toggleElement
(
'
manual-character-input
'
);
}
...
...
@@ -96,6 +105,13 @@ function isFormValid() {
document
.
getElementById
(
'
category-validation
'
).
style
.
display
=
'
none
'
;
}
if
((
inputObj
.
numberOfCharacters
<
100
&&
(
inputObj
.
schoolLevel
===
'
1
'
||
inputObj
.
schoolLevel
===
'
2
'
)))
{
invalidFields
++
;
document
.
getElementById
(
'
min-count-validation
'
).
style
.
display
=
'
block
'
;
}
else
{
document
.
getElementById
(
'
min-count-validation
'
).
style
.
display
=
'
none
'
;
}
return
invalidFields
<
1
}
...
...
@@ -238,7 +254,7 @@ function calculateReadingTime() {
}
}
// function getFormatted
t
ime
// function getFormatted
T
ime
// accepts seconds value and returns in hh:mm:ss format
function
getFormattedTime
(
totalSeconds
)
{
let
hours
=
Math
.
floor
(
totalSeconds
/
3600
);
...
...
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