How can I hide the back button from KTStepper?
if (stepperObj.getCurrentStepIndex() === 5). <- step after submit from step 4
when I'm on step 5 I dont want users to be able to go back to the form and re-submit, I don't see in the documentation how to hide it or disable it after the form is submitted, can anyone please help? Thanks
Hi,
You can check this stepper example to use custom buttons for back and forward buttons.
We will need to do an enhancement in the next update to hide the built-back button on the last step.
In the meantime you can edit src/sass/components/stepper/_base.scss
// Base
.stepper {
&.last {
[data-kt-stepper-action="previous"][data-kt-stepper-state="hide-on-last-step"] {
display: none !important;
}
}
}
data-kt-stepper-state="hide-on-last-step"
attribute to hide the back button on the last step:<button type="button" class="btn btn-lg btn-light-primary me-3" data-kt-stepper-action="previous" data-kt-stepper-state="hide-on-last-step">
Back
</button>
Thank you Sean,
It worked as expected!
Hi ,
Great! If you need any further help please do let us know.
Regards!