I've been working on creating a form that displays a success message after JavaScript validation checks are successful. To show the success message, I'm utilizing Bootstrap alert. I split my code into two files - one for common validation functions and another to check if validation is true. In the second file, I attempted to use a conditional statement to display the success message when valid is true, but it's not functioning as expected. What type of condition should I implement to ensure the success message appears?
Form
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
...
</body>
</html>
Style
*{
...
}
.form{
margin: 50px;
...
}
...
validationCommon.js
function resetErrors(inputs, errorTexts, errorInfo) {
...
}
...
validationMovieForm.js
function validateForm() {
...
}