How to move to a specific page using java script? | Experience Community
Skip to main content
Solved

How to move to a specific page using java script?

  • Jan 26, 2019 1:48 AM UTC
  • 4 replies
  • 119 views

Forum|alt.badge.img
I want to be able to send people to a page in the survey if they take too long on the current page. This is not the next page, so I cannot simply do a $(NextButton).run(). I also don't want to do it through Survey Flow because it will create another problem with the previous button on the following page. Any ideas?

Best answer by TomG

Add a “too long” choice to your question and have it skip to where you want. In the JS hide the “too long” choice and have the timer code (the timer will have to be in JS, not a timer question) select “too long” and click the Next button on timeout.
View original

4 replies

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • Answer
  • Jan 27, 2019 3:18 AM UTC
Add a “too long” choice to your question and have it skip to where you want. In the JS hide the “too long” choice and have the timer code (the timer will have to be in JS, not a timer question) select “too long” and click the Next button on timeout.

Forum|alt.badge.img
  • Author
  • Jan 28, 2019 12:35 AM UTC
Clever solution! Thanks!

Forum|alt.badge.img
  • Author
  • Jan 28, 2019 5:37 AM UTC
> @TomG said: > Add a “too long” choice to your question and have it skip to where you want. In the JS hide the “too long” choice and have the timer code (the timer will have to be in JS, not a timer question) select “too long” and click the Next button on timeout. The problem is that now, there is a blink when the screen is displayed. It first shows the "too long message" (I decided to use a message rather than a radio button) and then it disappears. It is quick, but it is noticeable. I have been trying to do something changing color of the font, setting it to white and then changing it to black, but hasn't been able to make it work. Any idea? Thanks

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • Jan 28, 2019 2:42 PM UTC
> @Mauricio said: > The problem is that now, there is a blink when the screen is displayed. It first shows the "too long message" (I decided to use a message rather than a radio button) and then it disappears. It is quick, but it is noticeable. I have been trying to do something changing color of the font, setting it to white and then changing it to black, but hasn't been able to make it work. Any idea? > Thanks Add a `<div>` with a lot of height (e.g. 1500px) to the top of your question text to push the question off the bottom of the screen, then hide it at the of addOnReady.