From f98cc68d402d23fe9ff0a0fb838e6d8482958a73 Mon Sep 17 00:00:00 2001 From: Dalin Akrasi Date: Thu, 19 Sep 2024 09:00:51 +0100 Subject: [PATCH] Identify Radio Buttons Error Messages PT2 --- .../Views/MyAccount/ChangeCurrentRole.cshtml | 2 +- .../Views/Shared/_ValidationScriptsPartial.cshtml | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/LearningHub.Nhs.WebUI/Views/MyAccount/ChangeCurrentRole.cshtml b/LearningHub.Nhs.WebUI/Views/MyAccount/ChangeCurrentRole.cshtml index 137bcbf88..40938608d 100644 --- a/LearningHub.Nhs.WebUI/Views/MyAccount/ChangeCurrentRole.cshtml +++ b/LearningHub.Nhs.WebUI/Views/MyAccount/ChangeCurrentRole.cshtml @@ -67,7 +67,7 @@ populate-with-current-values="true" radios="@Model.RoleRadio().ToList()" hint-text="" - required-client-side-error-message="Select a role" + required-client-side-error-message="Error: Select a role" required="true" />
diff --git a/LearningHub.Nhs.WebUI/Views/Shared/_ValidationScriptsPartial.cshtml b/LearningHub.Nhs.WebUI/Views/Shared/_ValidationScriptsPartial.cshtml index 3bd08f428..eb4f4485d 100644 --- a/LearningHub.Nhs.WebUI/Views/Shared/_ValidationScriptsPartial.cshtml +++ b/LearningHub.Nhs.WebUI/Views/Shared/_ValidationScriptsPartial.cshtml @@ -26,9 +26,9 @@ $(function () { $('form').each(function () { if ($(this).data("validator")) { - var valSettings = $(this).data("validator").settings - valSettings.highlight = wrap($.validator.defaults.highlight, highlightDecorator) - valSettings.unhighlight = wrap($.validator.defaults.unhighlight, unhighlightDecorator) + var valSettings = $(this).data("validator").settings; + valSettings.highlight = wrap($.validator.defaults.highlight, highlightDecorator); + valSettings.unhighlight = wrap($.validator.defaults.unhighlight, unhighlightDecorator); } }); }); @@ -37,7 +37,6 @@ return function () { var args = Array.prototype.slice.call(arguments); beforeFunction.apply(this, args); - if (errorElements.length && submitAttempted) { errorElements[0]['obj'].focus(); submitAttempted = false;