Disable checkbox options

Hello, guys. I have this CheckboxList::make('mealPlan') ->columns(3) ->label(' ') ->reactive() ->options([ 'breakfast' => "Breakfast", 'lunch' => "Lunch", 'dinner' => "Dinner", 'allInclusive' => 'All Inclusive', 'halfBoard' => 'Half-board', 'none' => 'None' ]), Is it possible to disable breakfast, lunch, dinner, halfBoard, none when allInclusive is checked?
4 Replies
Dennis Koch
Dennis Koch2y ago
I don’t think there is a method to disable single entries.
DianaMujoiu
DianaMujoiuOP2y ago
Have you please another idea of how can I implement what I need?
Dan Harrin
Dan Harrin2y ago
youd probably need a custom field as ours doesnt support that or use separate checkboxes, which you can disable individually
DianaMujoiu
DianaMujoiuOP2y ago
Ok. Thank you all And one more question, please. TextInput::make('name') ->reactive() ->regex('/^[a-zA-Z]+$/') ->minLength(2) ->maxLength(50) ->required(), I have this TextInput with regex validation. Is there a way to show the validation error in realtime instead of showing it after the user click on create/edit? Or should I use mask to prevent the user from entering certain characters?
Want results from more Discord servers?
Add your server