How to display a custom message when there are no options to display in Checkbox list?

Is there a way to display a custom message to the user when there are no options do display in Checkbox list? I have found only this: https://filamentphp.com/docs/3.x/forms/fields/checkbox-list#setting-a-custom-no-search-results-message but it's for search and I am not using search. My usecase is that I am looking for DB records and I am displaying them in the Checklist. However, there could be a situation when there are no records at all. So, how to deal with that?
2 Replies
Wirkhof
WirkhofOP9mo ago
The ideal solution would be to show a custom new HtmlString() message when there are no options for checkbox at all. Do you know how to do that? Any idea?
awcodes
awcodes9mo ago
Add a Placeholder/ViewField with the message and your checkbox list in the form then conditionally show or hide them based of the record’s field value that you need.
Want results from more Discord servers?
Add your server