Skip to content

Commit 9874f1b

Browse files
Merge pull request #772 from TechnologyEnhancedLearning/Develop/Fixes/TD-5086-Showing-console-errors-on-LH-Landingpage
TD-5086: Fixed console errors on LH landing page
2 parents 32364c4 + 3f786e9 commit 9874f1b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

LearningHub.Nhs.WebUI/Views/Shared/_ValidationScriptsPartial.cshtml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@
2121
2222
let errorElements = [];
2323
let submitAttempted = false;
24-
document.querySelector('form').onsubmit = () => { submitAttempted = true; }
24+
const form = document.querySelector('form');
25+
if (form) {
26+
form.onsubmit = () => { submitAttempted = true; }
27+
}
2528
2629
$(function () {
2730
$('form').each(function () {

0 commit comments

Comments
 (0)