From 63da6010fe7410a54e3acfef4f0295468331db0b Mon Sep 17 00:00:00 2001 From: Josh Deeden Date: Wed, 5 Aug 2026 10:41:02 -0700 Subject: [PATCH] Reset error styling on the terms checkboxes (#491) Field errors are applied to the input's closest '.form-group' or '.checkbox' container, but the reset at the top of the save handler only cleared '.form-group'. The two terms checkboxes on the new-ride form live in '
', so has-error was added to them and never removed. The adjacent resets are selector-agnostic ($('[aria-invalid="true"]') and $('.help-block')), which is why only the red styling persisted: a corrected checkbox stayed red with its explanatory message gone. The stale class also fed the accordion logic, which keys off $('.has-error') to decide which panels to show, pinning the Terms panel open on every resubmit. Only the new-ride form is affected; the edit form has no Terms panel. --- site/themes/s2b_hugo_theme/assets/js/cal/addevent.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/site/themes/s2b_hugo_theme/assets/js/cal/addevent.js b/site/themes/s2b_hugo_theme/assets/js/cal/addevent.js index 4b60473b..3fb05dba 100644 --- a/site/themes/s2b_hugo_theme/assets/js/cal/addevent.js +++ b/site/themes/s2b_hugo_theme/assets/js/cal/addevent.js @@ -178,7 +178,9 @@ $('.save-button, .publish-button').click(function() { let postVars, isNew = !shiftEvent.id; - $('.form-group').removeClass('has-error'); + // must match the containers used when errors are applied below; + // the terms checkboxes live in '.checkbox', not '.form-group'. + $('.form-group, .checkbox').removeClass('has-error'); $('[aria-invalid="true"]').attr('aria-invalid', false); $('.help-block').remove(); $('.save-result').removeClass('text-danger').text('');