Free text radio option
As a simple example, a radio field "Your favorite color?" with values
red
, green
, and other (please specify)
and when other is chosen input is shown that allows entering any value.
I think this is quite common behaviour in web forms but struggle to find a good solution. I can have text input depending on radio and display it only when
other` is selected but:
1 . The UI feels off, since they are separated out
2. I can't set the value of radio from input since it has fixed allowed values, so I have to create a third hidden field.
Has someone created this setup?4 Replies
Instead of a Radio field, consider a Multi-Select field: https://filamentphp.com/docs/3.x/forms/fields/select#multi-select
Another example: https://www.youtube.com/watch?v=mj3cmQjsppQ
Filament Daily
YouTube
Filament Select: Add New Option "On-the-fly"
If you have a Select dropdown with a relationship, you can easily add a new option without leaving the active form.
(from FilamentDaily YT)
Thanks for your response, but both examples are not what I need.