config-form.html - Fix rendering of client-side validation error for "server_route"
authorTim Otten <totten@civicrm.org>
Wed, 3 Feb 2021 08:35:14 +0000 (00:35 -0800)
committerTim Otten <totten@civicrm.org>
Wed, 3 Feb 2021 09:06:34 +0000 (01:06 -0800)
ext/afform/admin/ang/afGuiEditor/config-form.html

index 1a3ac253c8cd5690637c493ce50621279515d207..a8689c2603f996e26c5439f6f1ac13306b47012c 100644 (file)
   <!-- "Semi-private": not generally public, but not audited for secrecy -->
 </div>
 
-<div class="form-group">
+<div class="form-group" ng-class="{'has-error': !!config_form.server_route.$error.pattern}">
   <label for="af_config_form_server_route">
     {{:: ts('Page:') }}
   </label>
-  <input ng-model="afform.server_route" class="form-control" id="af_config_form_server_route" pattern="^civicrm\/[-0-9a-zA-z\/_]+$" onfocus="this.value = this.value || 'civicrm/'" onblur="if (this.value === 'civicrm/') this.value = ''" title="{{:: ts('Path must begin with &quot;civicrm/&quot;') }}">
-  <p class="help-block">{{:: ts('Expose the form as a standalone webpage. (Must begin with "civicrm/" e.g. "civicrm/my-form")') }}</p>
+  <input ng-model="afform.server_route" name="server_route" class="form-control" id="af_config_form_server_route" pattern="^civicrm\/[-0-9a-zA-z\/_]+$" onfocus="this.value = this.value || 'civicrm/'" onblur="if (this.value === 'civicrm/') this.value = ''" title="{{:: ts('Path must begin with &quot;civicrm/&quot;') }}">
+  <p class="help-block">{{:: ts('Expose the form as a standalone webpage. (Example: "civicrm/my-form")') }}</p>
 </div>
 
 <div class="form-group" ng-if="!!afform.server_route">