F
Filament15mo ago
Dom

Disable a toggle component in a resource if another a certain text input is empty

As title says. I want to disable or enable a toggle component depending on whether the numeric text input is empty or not. The component i want to disable has 'is_highlighted' in the make function and the component i want to check has ''order'. This is what i've tried.
->afterStateUpdated(function ($value, $state, $formRequest) {
if (!empty($value)) {
$formRequest->setComponentProperty('is_highlighted', 'disabled', true);
return;
}
$formRequest->setComponentProperty('is_highlighted', 'disabled', false);
}),
->afterStateUpdated(function ($value, $state, $formRequest) {
if (!empty($value)) {
$formRequest->setComponentProperty('is_highlighted', 'disabled', true);
return;
}
$formRequest->setComponentProperty('is_highlighted', 'disabled', false);
}),
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server