Reputation: 321
I'm wondering how did they control the multi-step form using browser back button, Veterans United and Canada Drives does it. I have a multi-step form controled by Jquery what I need to do is to copy their style that instead of changing the page when you click the browser back button it will just go to previous step.
Thanks
https://www.veteransunited.com/
Upvotes: 1
Views: 1400
Reputation: 3020
Looks like they're using history api.
Pushstate when user clicks on the continue button.
history.pushState(obj, "title", "#")
And listening for popstate event which is fired when user clicks browser back button.
Upvotes: 3