Multiple input fields for one label

I'm trying to convert an existing form to a filament form, one of the input fields in the form is a combination of two components, an input field, and a select. These two together determine the value of the field on the model. See screenshot for more context. Currently i've got it "working" in a hacky way, a custom FormField with a custom view. But I want to know if something like this is also possible with plain Filament.
13 Replies
bwubs
bwubsOP2y ago
This is a part of the original form:
bwubs
bwubsOP2y ago
toeknee
toeknee2y ago
Use a grid? Can you provide more info on how the data stores?
bwubs
bwubsOP2y ago
I've tried using a grid, but somehow the grid is not renered it's stored as one string, the moment is stored as a negative value when it's before and positive when after. The time is stored as a normal string like 09:00 in the database. This is just to make it simpler for users to select instead of type It's already inside a card. Can a grid be placed inside a card? Let me try the grid again seems to work now, but I need a label in front
bwubs
bwubsOP2y ago
LeandroFerreira
like this?
Group::make([
TextInput::make('moment')
->required()
->inlineLabel()
->suffix('dagen'),
Select::make('select')
->disableLabel()
->suffix('gebeurtenis')
])->columns(2)
Group::make([
TextInput::make('moment')
->required()
->inlineLabel()
->suffix('dagen'),
Select::make('select')
->disableLabel()
->suffix('gebeurtenis')
])->columns(2)
bwubs
bwubsOP2y ago
I was using grid, but the problem remains I need the label Moment in front of it, as these two fields are together the value for one property on the model. i've given te group a label, but it seems that it doesn't do anything It's getting there!
bwubs
bwubsOP2y ago
bwubs
bwubsOP2y ago
It only needs align with the row underneath
toeknee
toeknee2y ago
Do 3 fields? Grid of 3, field 1 is a place holder other two are the field
bwubs
bwubsOP2y ago
I'm toying a bit wit putting all other items also in a group will post my final form later, just to see if there are other ways of doing it
Mansoor Khan
Mansoor Khan2y ago
@bwubs any news you got it working? can you help me, i also need a similar field.
bwubs
bwubsOP2y ago
Hi, haven’t been working on it for a few weeks. Actually, a colleague has taken over this specific task as I’m currently not at work for an extended period of time.
Want results from more Discord servers?
Add your server