Wanted: JavaScript Guru - Recursion problem/error

wxdqz

New Member
Hello All,

I have made a lot of progress with JavaScript in the last week. But, I have hit a wall now!!!

Please look at my script and tell me why I am getting this little error. I want to press the next button repeatedly and not get errors. Must I do some sort of clear/reset each time??? At some point I will add some logic (i.e., if x = 20 THEN (Press FINISH Button) execute an allFinished Function.

Thanks,
Vincent

Z黵ich, Switzerland
Go Raiders





<HTML>
<HEAD>
<SCRIPT>
var S = 0;
var p = 1;
var tpq = 5;

function getRandom() {
s = Math.round((p - 0.5) + (((tpq + 0.49999) - (p- 0.5)) * Math.random()));
getNext();
return r;
}

function getNext() {
document.write('<p><input type="radio" value=http://www.webdeveloper.com/forum/archive/index.php/"a" name="q10"> Senegal<br></p>') ;
document.write('<p><input type="radio" value=http://www.webdeveloper.com/forum/archive/index.php/"b" name="q10">' + " " + s + '</span></<br></p>') ;
document.write('<p><input type="radio" value=http://www.webdeveloper.com/forum/archive/index.php/"c" name="q10"> Nigeria<br></p>') ;
document.write('<p><input type="radio" value=http://www.webdeveloper.com/forum/archive/index.php/"d" name="q10"> Iraq<br></p>') ;
document.write('<INPUT type="button" value=http://www.webdeveloper.com/forum/archive/index.php/" Next" onClick=" getRandom()">');
return r;
}

</SCRIPT>
</HEAD>

<BODY>
<FORM name="QForm">
<INPUT type="button" value=http://www.webdeveloper.com/forum/archive/index.php/"Start" onClick=" getRandom()">
</FORM>
</BODY>
</HTML>
 
Back
Top