oTree Forum >

Avoid going to the next page in a new tab/window

#1 by Juanfran (edited )

Hello community,

Is there any way to prevent a participant can go to the next page of an experiment in a new tab/window while preserving the current page information in the same window/tab?

If you use the usual otree next button by clicking it while holding the control key, you can preserve the page (if you don't refresh it) and go to the following page in a new tab of the browser. The same can be done by holding the shift key but obtaining the next page in a new window instead of a new tab. How could this be avoided? Note that I want to avoid this for the usual otree next button. I saw some posts about how to partially avoid this for hyperlinks (by changing the "href" method of an <a> element), but this is not possible for a button that has no link (as the otree one, since the link refers to the next page of the experiment.

This is an important problem since participants could use both tricks to go ahead in the experiment preserving the previous things done (if they don't refresh the old clicked pages), something that, for many studies, is totally undesired.

If there is someone who knows any solution using JavaScript, it would be very useful! I have been looking for a solution, unfortunately, without success. If there is no direct solution, I was wondering whether there is a method that forces a page to be refreshed after clicking a button, so once the next button is clicked, the page is refreshed (and then, if you clicked it while holding the control/shift key, you will have two tabs/windows with the same page).

Best,

Juanfran

Write a reply

Set forum username