FilamentF
Filament15mo ago
TegarJK

Auto naming based on 3 select input fields

So i want to auto naming the program name based on user input on 3 select option , the type of internship , start month and get the current name of the requester, its like a slug but dependant on more fields, how to achieve that? the format of the program name will be "name - type - start month"
image.png
Solution
Make your select inputs ->live()

Then use something like this
->afterStateHydrated(fn(Forms\Get $get, Forms\Set $set) => self::setProgramName($get, $set))


public static function setProgramName($get, $set)
{
// Check if you have values in selects
// Using $get('field')
// Construct and set the program name using $set
}
Was this page helpful?