Open bkardell opened 2 months ago
I tried to provide a number of options for customizing the messages presented via attributes. If you have suggestions for ways the messaging could be improved upon, I’m open to them. One idea might be the ability to slot in details like this:
error="You have chosen {count} items. Please choose only {required} items."
Where "count" pipes through the total items currently chosen and "required" inserts the value of the required attribute. I also considered a "difference" option, but that gets a little hairier when it comes to translations for contextual things like "fewer" and "more."
My main suggestion is to improve the messaging on the demo where 'only' doesn't always make sense
Ok. So, just for clarity, is your issue that the "only" in that example could be viewed as confusing when you've picked less than 3 items?
Sorry for the very delayed reply, but:....
yes.
In checking out the demo I (accidentally) discovered that the demo at least doesn't seem to expect what I did. Effectively in the demo has
<form-required-checkboxes required="3" notice="Choose 3 options" error="Please be sure to pick only 3 items">
And I picked only 1 - this seems like a pretty common kind of error. To me, the error here was confusing. I suppose you could make the error say "please choose exactly 3 items". Or, alternatively, maybe maybe could make the error API handle more cases.