Click here to Skip to main content
16,004,564 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys,

I'm making this type of survey; nothing serious. First page is the intro page where i say welcome, blablabla. Second page asks name and occupation. Third page, i'll ask everybody questinos, and to choose answers, they<ll have to check radio buttons (each radio button is a grade from 1/10 to 10/10). Once they choose their answers and click submit, their answers will have been console.logged. When they click submit, this third html disappears and another fourth HTML appears (saying stuff like thank for taking the survey). I want that fourth html to automatically redirect to the first, intro page after, say, 10 seconds. Then, the whole cycle restarts.

Is that possible? Maybe with Javascript/jQuery?

All this is in one HTML, CSS, and JS file ( I want it to be like that).

Thank you so much.

What I have tried:

Not much, as my research has been completely fruitless. I don't even know where to start.
Posted
Updated 15-Jan-18 16:54pm

1 solution

On your last page that you wish to redirect you'd need to use the setTimeOut function. So you'd do something like

JavaScript
setTimeout(function(){
   window.location.replace("http://url/to/the/first/page/of/your/survey.html");
}, 10000);


Where 10000 is the amount of time it will wait before executing. So if you wanted 15 second wait, then it would be 15000 as this value is in milliseconds.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900