F
Filament6mo ago
Abi

Required validation for Radio button fails

not sure if it is just me, but the required validation for a radio button seems to fail. can someone confirm? Here is the code
Radio::make('customer_type')
->label('Are you a new customer?')
->options([
'YES' => 'Yes',
'NO' => 'No'
])->inline()->columnSpan(2)
->required(),
Radio::make('customer_type')
->label('Are you a new customer?')
->options([
'YES' => 'Yes',
'NO' => 'No'
])->inline()->columnSpan(2)
->required(),
4 Replies
Abi
Abi6mo ago
A default is never selected, I have even tried to use the default() method it doesn't set it
Abi
Abi6mo ago
No description
DrByte
DrByte6mo ago
I just pasted your code into one of my existing forms, clicked Edit, chose nothing, and clicked Submit ... and the validation triggered correctly:
DrByte
DrByte6mo ago
No description