How to disable previous action

Ive already seen a question like this, but i don't want to make it visually disabled. But to prevent the user from going back at all. Is this possible?
6 Replies
toeknee
toeknee3w ago
PRevious back in the page?
Harold
HaroldOP3w ago
Oh sorry I didnt specify it. In the wizard form
Bruno Pereira
Bruno Pereira3w ago
you can try this
->afterValidation(function () {
// ...

if (currentStep < nextStep) {
throw new Halt();
}
})
->afterValidation(function () {
// ...

if (currentStep < nextStep) {
throw new Halt();
}
})
Bruno Pereira
Bruno Pereira3w ago
I guess if your wizard has 3 steps and you're in step 2 and want to go to step 1 the "next step" is the number 1
toeknee
toeknee3w ago
if you add this to the wizard it will disable back and then hide the button:
->previousAction(fn ($action) => $action->visible(false)->extraAttributes(['style' => 'display:none;']))
->previousAction(fn ($action) => $action->visible(false)->extraAttributes(['style' => 'display:none;']))
Want results from more Discord servers?
Add your server