Commit f3f9462c authored by Ratnadeep Rajendra Kharade's avatar Ratnadeep Rajendra Kharade
Browse files

allowed calculation once the form is valid

parent c95ca4ef
Pipeline #1076 passed with stages
in 3 seconds
......@@ -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() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment