F
Filament14mo ago
qcol

Different form components depending on whether it is editing or creating.

Hi! I have a form containing a Select ("item_id" - a list of data from a relational table). When I save to the database using mutateFormDataUsing I save the name I extracted from the Select to another string field "item_name". Therefore, when editing, I no longer want to use Select for this field but a simple TextInput (Select was only helpful in creating a record). How do I make it so that during "create" it is Select (item_id) and during "edit" it is TextInput (item_name)?
2 Replies
qcol
qcol14mo ago
Thanks a lot, it works as I expected! I saw this option in the manual but I thought that the option converts the field into an input type hidden so I was afraid that the second field would still exist (as type hidden) so it would be a problem to give required() in both cases.