Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Pado
Behira Younes
Commits
b76526aa
Commit
b76526aa
authored
4 years ago
by
Ratnadeep Rajendra Kharade
Browse files
Options
Download
Email Patches
Plain Diff
fixed error with valdation message
parent
210ed922
Pipeline
#1133
passed with stages
in 11 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
public/index.js
+22
-3
public/index.js
with
22 additions
and
3 deletions
+22
-3
public/index.js
+
22
-
3
View file @
b76526aa
...
@@ -20,7 +20,22 @@ function handleTextRadioClick() {
...
@@ -20,7 +20,22 @@ function handleTextRadioClick() {
let
value
=
document
.
getElementById
(
"
inputTextCharacters
"
).
value
;
let
value
=
document
.
getElementById
(
"
inputTextCharacters
"
).
value
;
setCharacterLength
(
value
);
setCharacterLength
(
value
);
}
}
isFormValid
();
// show or hide validation messages
if
(
inputObj
.
textChoice
===
'
manual
'
&&
inputObj
.
text
===
''
)
{
//document.getElementById('textarea-validation').style.display = 'block';
}
else
{
document
.
getElementById
(
'
textarea-validation
'
).
style
.
display
=
'
none
'
;
}
if
(
inputObj
.
textChoice
===
'
calculated
'
&&
(
inputObj
.
numberOfCharacters
===
''
||
inputObj
.
numberOfCharacters
===
0
))
{
//document.getElementById('textCharacters-validation').style.display = 'block';
}
else
{
document
.
getElementById
(
'
textCharacters-validation
'
).
style
.
display
=
'
none
'
;
}
toggleElement
(
'
character-calculation-wrapper
'
);
toggleElement
(
'
character-calculation-wrapper
'
);
toggleElement
(
'
manual-character-input
'
);
toggleElement
(
'
manual-character-input
'
);
}
}
...
@@ -66,7 +81,11 @@ function handleCharacterInputChange() {
...
@@ -66,7 +81,11 @@ function handleCharacterInputChange() {
// function setCharacterLength: sets number of characters to property numberOfCharacters on inputObj
// function setCharacterLength: sets number of characters to property numberOfCharacters on inputObj
function
setCharacterLength
(
characters
)
{
function
setCharacterLength
(
characters
)
{
inputObj
.
numberOfCharacters
=
parseInt
(
characters
);
if
(
characters
===
''
)
{
inputObj
.
numberOfCharacters
=
0
;
}
else
{
inputObj
.
numberOfCharacters
=
parseInt
(
characters
);
}
}
}
...
@@ -83,7 +102,7 @@ function isFormValid() {
...
@@ -83,7 +102,7 @@ function isFormValid() {
}
}
if
(
inputObj
.
textChoice
===
'
calculated
'
&&
if
(
inputObj
.
textChoice
===
'
calculated
'
&&
(
inputObj
.
textLe
numberOfCharacters
ngth
===
''
||
inputObj
.
numberOfCharacters
===
0
))
{
(
inputObj
.
numberOfCharacters
===
''
||
inputObj
.
numberOfCharacters
===
0
))
{
invalidFields
++
;
invalidFields
++
;
document
.
getElementById
(
'
textCharacters-validation
'
).
style
.
display
=
'
block
'
;
document
.
getElementById
(
'
textCharacters-validation
'
).
style
.
display
=
'
block
'
;
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Explore
Projects
Groups
Snippets