Skip to content

Commit

Permalink
feat(formvalidation): add error variants
Browse files Browse the repository at this point in the history
More detailed variants for add errors as of fomantic/Fomantic-UI#2680
  • Loading branch information
lubber-de authored Feb 2, 2023
1 parent 990c986 commit 2a7bd46
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions server/documents/behaviors/form.html.eco
Original file line number Diff line number Diff line change
Expand Up @@ -1946,7 +1946,7 @@ type : 'UI Behavior'

<table class="ui definition celled table">
<tr>
<td class="four wide">submit</td>
<td class="five wide">submit</td>
<td>Submits selected form</td>
</tr>
<tr>
Expand Down Expand Up @@ -1990,8 +1990,8 @@ type : 'UI Behavior'
<td>Returns value of element with id</td>
</tr>
<tr>
<td>get values(identifiers)</td>
<td>Returns object of element values that match array of identifiers. If no IDS are passed will return all fields</td>
<td>get values([identifiers])</td>
<td>Returns object of element values that match array of string identifiers. If no IDs are passed will return all fields</td>
</tr>
<tr>
<td>set value(identifier, value)</td>
Expand All @@ -2010,16 +2010,16 @@ type : 'UI Behavior'
<td>Returns whether a field exists</td>
</tr>
<tr>
<td>add errors(errors)</td>
<td>Manually add errors to form, given an array errors</td>
<td>add errors(error)<br>add errors([errors])<br>add errors({identifier:error})<br>add errors({identifier:[errors]})</td>
<td>Manually add errors to form, given an array of string errors or an object using keys as field identifier each containing an error string/array of strings value. Such object will automatically add the field label infront of the error message or, if <code>inline:true</code>, will display the inline prompt to the related field. </td>
</tr>
<tr>
<td>remove errors</td>
<td>Removes all current errors from the error message box</td>
</tr>
<tr>
<td>add prompt(identifier, errors)</td>
<td>Adds a custom user prompt for a given element with identifier</td>
<td>add prompt(identifier, error)<br>add prompt(identifier, [errors])</td>
<td>Adds a custom user prompt for a given element with identifier displaying a given string or an array of strings as a <a href="/elements/list.html#bulleted">bulleted list</a></td>
</tr>
<tr>
<td>clear</td>
Expand Down Expand Up @@ -2178,7 +2178,7 @@ type : 'UI Behavior'
notExactly : '{name} cannot be set to exactly \'{ruleValue}\'',
contain : '{name} cannot contain \'{ruleValue}\'',
containExactly : '{name} cannot contain exactly \'{ruleValue}\'',
doesntContain : '{name} must contain \'{ruleValue}\'',
doesntContain : '{name} must contain \'{ruleValue}\'',
doesntContainExactly : '{name} must contain exactly \'{ruleValue}\'',
minLength : '{name} must be at least {ruleValue} characters',
exactLength : '{name} must be exactly {ruleValue} characters',
Expand All @@ -2188,7 +2188,8 @@ type : 'UI Behavior'
creditCard : '{name} must be a valid credit card number',
minCount : '{name} must have at least {ruleValue} choices',
exactCount : '{name} must have exactly {ruleValue} choices',
maxCount : '{name} must have {ruleValue} or less choices'
maxCount : '{name} must have {ruleValue} or less choices',
addErrors : '{name}: {error}',
}
</div>
</td>
Expand Down Expand Up @@ -2437,12 +2438,12 @@ type : 'UI Behavior'
<td colspan="2">
<div class="code">
errors : {
identifier : 'You must specify a string identifier for each field',
method : 'The method you called is not defined.',
noRule : 'There is no rule matching the one you specified',
oldSyntax : 'Starting in 2.0 forms now only take a single settings object. Validation settings converted to new syntax automatically.'
noField : 'Field identifier {identifier} not found',
noElement : 'This module requires ui {element}'
method : 'The method you called is not defined.',
noRule : 'There is no rule matching the one you specified',
oldSyntax : 'Starting in 2.0 forms now only take a single settings object. Validation settings converted to new syntax automatically.'
noField : 'Field identifier {identifier} not found',
noElement : 'This module requires ui {element}',
noErrorMessage: 'No error message provided',
}
</div>
</td>
Expand Down

0 comments on commit 2a7bd46

Please sign in to comment.