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
f3f9462c
Commit
f3f9462c
authored
Oct 21, 2020
by
Ratnadeep Rajendra Kharade
Browse files
allowed calculation once the form is valid
parent
c95ca4ef
Pipeline
#1076
passed with stages
in 3 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
public/index.js
View file @
f3f9462c
...
...
@@ -43,12 +43,13 @@ function setCharacterLength(characters) {
}
function
calculateReadingTime
()
{
let
isFormValid
=
validateForm
();
let
x
=
document
.
getElementById
(
'
calculate-time-element
'
);
x
.
style
.
display
=
"
block
"
;
if
(
isFormValid
())
{
let
x
=
document
.
getElementById
(
'
calculate-time-element
'
);
x
.
style
.
display
=
"
block
"
;
}
}
function
validateForm
()
{
function
isFormValid
()
{
let
invalidFields
=
0
;
if
(
inputObj
.
textChoice
===
'
manual
'
&&
inputObj
.
text
===
''
)
{
invalidFields
++
;
...
...
@@ -77,7 +78,9 @@ function validateForm() {
}
else
{
document
.
getElementById
(
'
readerCategory-validation
'
).
style
.
display
=
'
none
'
;
}
return
invalidFields
<
1
}
function
showFeedbackForm
()
{
...
...
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