I have a simple wizard that only needs a 'previous' and 'next' button. On the the third and final step, the next button launches a file uploader.
So far, I have this:
I did this to make it easier to reference the buttons themselves.
$( document ).ready(function() {
$("#wizard .actions a[href='#next']").attr("id","next_button");
$("#wizard .actions a[href='#previous']").attr("id","previous_button")
});
Then here's the body of my code:
$("#wizard").steps({
bodyTag: "section",
transitionEffect: "slideLeft",
autoFocus: true,
enableFinishButton: false,
enableCancelButton: false,
onStepChanged: function (event, currentIndex, priorIndex) {
if (currentIndex ==2 ) {
console.log('currentIndex is:'+currentIndex);
//this returns '2' which is correct
$("#next_button").show();
$(function(){
$("#next_button").click(function(){
//custom function here
});
});
When I get to the third step (currentIndex = 2), the next step button disappears so I tried to do a $("#next_button").show(); but that does not work.
Any help, much appreciated!