Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

FormValidation.io Hide back button when form is submitted KTStepper


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


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (3)


Thank you Sean,

It worked as expected!



Hi happy,

Great! If you need any further help please do let us know.

Regards!


Your Support Matters!

We will highly appreciate your Metronic Review on Themeforest.
Please go to Themeforest Downloads page, select Metronic & leave your feedback.

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;
}
}
}


And add 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>


Then recompile your assets folder with Gulp or Webpack.

Please note that the build tools are only required in the development environment to compile the assets when the source folder files are modified. In the hosting/server deployment, you will only need the compile assets, no need to install the build tools dependencies there.

Regards.


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(