Is there a way to make this available ONLY on the last page? The code works fine for me, but there is a single scenario which doesn't get covered.
Assuming a form has for example 4 pages. The user fills out the first 3 and reaches the last. The links in the multipagenavigation become active. The user spots an issue and gets back to page 2 to resolve it. After that the user clicks the link to the last page (confirmation) and finds out that the data, which he/she just changed didn't made it through. The user is actually forced to click on "next" until he/she reaches the last page again - only then the data will get submitted.
That's why it would be better to simply have the possibility to use those multipage navi if on the last page (for my case). I'm not sure how other use cases will find this useful or not, but I'm aware that this is probably not the best from UX Point of view. But still better than having the user figuring out by hisself/herself that he/she needs to click on the "next" buttons to get the data through.
Edit: Btw: Keep up the good work :)