Fix dev/core#4949 ScheduleReminder form required field error
authorcolemanw <coleman@civicrm.org>
Wed, 7 Feb 2024 00:55:43 +0000 (19:55 -0500)
committercolemanw <coleman@civicrm.org>
Wed, 7 Feb 2024 19:27:56 +0000 (14:27 -0500)
templates/CRM/Admin/Form/ScheduleReminders.tpl

index f9db4a0f72845e0c19fcff50978b15643ebee435..df5a7d92d17c5482666c0610b0c7f0802a90d1fc 100644 (file)
                       $label = $('label[for=' + fieldSpec.name + ']', $form);
                     $label.text(fieldSpec.label);
                     if (fieldSpec.required) {
-                      $label.append(' <span class="crm-marker">*</span>')
+                      $label.append(' <span class="crm-marker">*</span>');
                     }
+                    // 'required' css class gets picked up by jQuery validate (but only in popup mode)
+                    // In full-page mode there is no clientside validation & this doesn't have any effect.
+                    // TODO: Would be nice for those things to be more consistent & also to use real html validation not jQuery.
+                    $field.toggleClass('required', fieldSpec.required);
                     $field.removeClass('loading');
                     // Show field and update option list if applicable
                     if (fieldSpec.options) {