Skip to content

Commit

Permalink
Changes markup for comment error messages in line with update to 4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrody committed Feb 21, 2024
1 parent 0ffd490 commit 71749d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions assets/js/comments.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ function addErrorPanel(errors) {

function addErrorMarker(field, errorText) {
field.parent("div.govuk-form-group").addClass("govuk-form-group--error");
field.siblings("label").append("<span class='govuk-error-message'>" + errorText + "</span>");
field.siblings("label").append("<p class='govuk-error-message'>" + errorText + "</p>");
}

function removeErrorMarker(field) {
field.siblings("label").find("span.govuk-error-message").remove();
field.siblings("label").find("p.govuk-error-message").remove();
field.parent("div.govuk-form-group").removeClass("govuk-form-group--error");
}

Expand Down

0 comments on commit 71749d7

Please sign in to comment.