'requiredError' Common Field Property
User Story
As a Form Designer, I can define the error to be displayed if a user fails to enter a required field, so the fact that the field is required is clear to the user.
Acceptance Criteria
- In a Form Model, the 'requiredError' property can be optionally defined for a data field, that defines the error message that should be displayed is the user fails to enter a value.
- When the form is rendered, if the data field is required #130 and the user fails to enter a value: a. If the 'requiredError' property is defined, the custom required error message is displayed. b. If the 'requiredError' property is not defined, a generic required error message is displayed.
Dev Notes
- requiredError defined as a thing allowing the error messages in multiple languages to be defined:
ui:requiredError [ rdfs:label "Social Security Number (SSN) is required"@en ] ;
Friendly amendment: requiredErrorMessage If you want a message...
or maybe we instantiate the error itself as a thing, and then have many labels on in different languages?
ui: requiredError [ rdfs:label "You have to give your SSN, sorry"@en ]
I will make the adjustment to the User Story. Will make equivalent update to #139 .
@timbl One question I have is why use rdfs:label? In other form language drafts/proposals I've seen a ui:label used instead, and I think they could have different semantic meanings (e.g. a label specifically designed and formatted to be consumed by a UI). If so, we could add a new issue for ui:label to be added, or alternately switch to rdfs:label for consistency.