-
Type: Feature
-
Status: Backlog
-
Priority: Medium
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: appng-formtags, appng-taglib
-
Labels:None
For <appNG:formElement> and <appNG:formGroup>, the class defined in errorClass replaces the class-attribute of the wrapped HTML input fields.
For certain integration scenarios (e.g. Bootstrap) it would be useful if the errorClass could be appended instead.
This reduces the overhead of adding existing classes to errorClass.
Example:
Before change:
<appNG:formElement errorClass="form-control is-invalid" rule="string" mandatory="true" errorMessage="Not a valid name!" mandatoryMessage="Name is mandatory" errorElementId="name-error"> <input type="text" name="name" value="" class="form-control" /> <div id="name-error" class="invalid-feedback" /> </appNG:formElement>
After change (introducing errorClassAppend)
<appNG:formElement errorClass="is-invalid" errorClassAppend="true" rule="string" mandatory="true" errorMessage="Not a valid name!" mandatoryMessage="Name is mandatory" errorElementId="name-error"> <input type="text" name="name" value="" class="form-control" /> <div id="name-error" class="invalid-feedback" /> </appNG:formElement>
The result, in both cases, assumed the field was empty when submitting:
<input type="text" name="name" value="" class="form-control is-invalid" /> <div id="name-error" class="invalid-feedback">Name is mandatory</div>