y2k1981,
Here is how I do it:
var response=0;
for (var i=1; i <= form1.selection.length; i++) {
if (form1.selection[i-1].checked) {
var response = i;
break;
}
}
If response == 0, then nothing was selected; otherwise, response holds the sequential number (not index) of the...
Following Horrid:<br>
Javascript's matJ = new Array(new Array(), new Array()) acts similar to VB's dim matV(2,dim2) but is more flexible in that the Javascript's matJ "rows" need not have the same length. Get the entry in the second row, third column of matJ by var x = matJ[1][2]...
Math.random() generates a pseudorandom number between 0 and 1. The code below stretches the interval (0,1) to (0,maximum-minimum), then adds minimum to get the new interval (minimum, maximum), then uses Math.floor to get an integer in the interval. Use whatever you like for minimum and...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.