Hi,
I click 'start' button, then start button is disabled as expected.
Once I click start button, i want to see the values of f1 and f2 on first row , values of f3 and f1 on the second row. First row is working just fine. but the second row i get only the value of f3 not the f1. Please advise!!
Thanks.
--
<html>
<?php
$_SESSION['num1'] = mt_rand(2,5);
$q1 = $_SESSION['num1'] ;
$_SESSION['num2'] = mt_rand(6,9);
$q2 = $_SESSION['num2'] ;
$_SESSION['num3'] = mt_rand(11,19);
$q3 = $_SESSION['num3'] ;
?>
<SCRIPT language="JavaScript">
<!--hide
function newtext()
{
document.getElementById("stBtn").disabled = true;
q1 = '<?php echo $q1 ;?>';
q2 = '<?php echo $q2 ;?>';
q3 = '<?php echo $q3 ;?>';
document.getElementById("f1").innerHTML = q1;
document.getElementById("f2").innerHTML = q2;
document.getElementById("f3").innerHTML = q3;
setTimeout("moretext()",9000);
}
function moretext()
{
document.myform.one.disabled = true;
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<FORM name="myform" method="post" action="sessionS1.php">
<table width='600' cellpadding='5' cellspacing='5' border='1'>
<tr><td colspan=6 align='right'><INPUT TYPE="button" id="stBtn" name="mytext" value="start " onClick="newtext()"></td></tr>
<tr> <td> Q1 </td> <td><p id="f1"></p> * <p id="f2"></p> </td> <td> <input type = 'text' size = '2' name = one > </td> </tr>
<tr> <td> Q1 </td> <td><p id="f3"></p> * <p id="f2"></p> </td> <td> <input type = 'text' size = '2' name = two > </td> </tr>
<tr><td colspan=6 align='right'><input type='submit' value='Score' name='btn_score'></td></tr>
</table>
</FORM>
</body>
</html>