I have page A and B. Once page A loads I will get input from the user. After 60 seconds, the page will automatically redirect to Page B. I did with the below code, but values are not getting passed.
<html>
<head>
<script type="text/javascript">
function printVal()
{
printVal.counter--;
document.getElementById("timer").innerHTML = printVal.counter;
if(printVal.counter==0){
window.location="next.php";
}
}
function callfun()
{
setInterval(printVal,1000);
}
printVal.counter=61;
</script>
</head>
<body>
<input type="submit" value="Click Me" onclick="callfun()">
<p id="timer"></p>
<form method='post' action='next.php'>
<input type='text' name='val'>
</form>
</body>
</html>
I’ve to create a list. Once the user types something in the text box and presses enter it should go and add it in a list box. After 60 seconds, I want the values in the list box to be passed to next.php.
Changing
window.locationwon’t submit the values in your form to the new location. You’ll have to submit the form instead.