• Resolved wppixl

    (@wppixl)


    i am trying to run some javascript everytime the “next” and “previous” buttons are clicked but it only seems to be executed once, and doesn’t work afterwards?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Marc Lacroix

    (@marcusig)

    Hi there,

    It’s probably because the buttons are re-rendered at every step, because their content might change.

    Can you share you JS here?

    Depending on what you want to do, you can also use the JS action PC.fe.steps.display_step E.g.

    wp.hooks.addAction( 'PC.fe.steps.display_step', 'your_context', function( steps_object ) {
        // Do your thing here
        console.log( 'changed step', steps_object.current_step );
    } );

    Marc

    Thread Starter wppixl

    (@wppixl)

    That was quick. Thank you, this worked.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Run js on every button click?’ is closed to new replies.