solid-ui icon indicating copy to clipboard operation
solid-ui copied to clipboard

'requiredError' Common Field Property

Open brownhoward opened this issue 6 years ago • 3 comments

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

  1. 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.
  2. 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 ] ;

brownhoward avatar Sep 27 '19 20:09 brownhoward

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 ]

timbl avatar Sep 27 '19 21:09 timbl

I will make the adjustment to the User Story. Will make equivalent update to #139 .

brownhoward avatar Sep 27 '19 21:09 brownhoward

@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.

james-martin-jd avatar Oct 02 '19 17:10 james-martin-jd