Using Javascript to go to next page
Copy link to clipboard
Copied
I'm trying to figure out how to advance to the next page in a captivate 3 course using Javascript. We have navigation buttons for "Prev" and "Next", but I'd like to be able to call some JavaScript when they click the Next button on a particular page, and then at the same time, advance to the next page.
This is being launched from an LMS. The initial JS is going to set the score to 100%, which works fine. We typically have a "Close Course" button on the last slide to make sure it passes back a 100%, but many students are not clicking that button and the course simply returns a "passed" with a 0%.
So making this JS call as part of the "Next" button should result in more 100% scores when they get to the end of the course, but I need it also to advance to the next slide.
Thanks for any assistance!
John
Copy link to clipboard
Copied
Hi there
Methinks you are overthinking this. Here's why.
Note that any Button or Click Box obeject will release the pause when it has been clicked by the user unless you specifically configure it not to. If you assign some JavaScript to the Button object and the user clicks it, it does two things.
- Carries out the assigned action
- Releases the pause so the movie continues playing
So I'm thinking in this case it's a simple matter of timing.
Cheers... Rick
Copy link to clipboard
Copied
Thanks for the reply.
I'm placing the JS code in the Button properties window in the on_success field. I have this set to "execute javascript". Initially it was set to "Go to Next Slide". When testing this out, it executes the JS, but I have to click on the button 3 times or so in order to advance to the next slide. The JS code runs immediately, so there's no delay in that. My goal is to have this auto advance to the next slide once the JS executes.
Thanks!
john

Copy link to clipboard
Copied
I'm curious if anyone has ever solved this.. I'm trying to do the exact same thing as John (jdalypa2) requested using Captivate v7.0.
Copy link to clipboard
Copied
This thread is over four years old. I would suggest creating a new post stating your reasons for wanting to do this. I would think an advanced action would be sufficient vs. doing JavaScript, but it all depends on your requirements. Please start a new thread.

