css: add red border around input fields with validation errors.

The .field_with_errors class is added by Simple Form to <input> fields
with validation errors.
This commit is contained in:
evazion
2021-02-22 00:13:53 -06:00
parent 1c1d784547
commit 40712fb726
2 changed files with 3 additions and 3 deletions

View File

@@ -135,13 +135,13 @@ ArtistCommentary.merge_commentaries = function(description, commentary) {
// Update commentary field if it's blank, signal an error if there's a conflict.
ArtistCommentary.update_field = function($field, value) {
$field.removeClass("validation-error");
$field.closest(".input").removeClass("field_with_errors");
if ($field.val().trim() === "") {
$field.val(value);
return true;
} else if ($field.val().trim() !== value) {
$field.addClass("validation-error");
$field.closest(".input").addClass("field_with_errors");
return false;
} else {
return true;

View File

@@ -44,7 +44,7 @@ form.simple_form {
}
}
input.validation-error {
&.field_with_errors input {
border: 1px solid var(--form-input-validation-error-border-color);
}