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"
No description
Solution:
Make your select inputs ->live() Then use something like this
->afterStateHydrated(fn(Forms\Get $get, Forms\Set $set) => self::setProgramName($get, $set))
->afterStateHydrated(fn(Forms\Get $get, Forms\Set $set) => self::setProgramName($get, $set))
...
Jump to solution
2 Replies
Solution
Tonkawuck
Tonkawuck2w ago
Make your select inputs ->live() Then use something like this
->afterStateHydrated(fn(Forms\Get $get, Forms\Set $set) => self::setProgramName($get, $set))
->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
}
public static function setProgramName($get, $set)
{
// Check if you have values in selects
// Using $get('field')
// Construct and set the program name using $set
}
TegarJK
TegarJK2w ago
it worked! thanks a lot
Want results from more Discord servers?
Add your server