I have a function that looks similiar to this: function test(n){var a=document.forms["n"].r2.value;}
The problem is, there's a variable I would like to change called "r2". I would like this to be rn, based on the number pased:
function test(1){var a=document.forms["n"].r1.value;}
function test(2){var a=document.forms["n"].r2.value;}
function test(3){var a=document.forms["n"].r3.value;}
I've tried the following, but it doesn't seem to work. Any ideas? Thanks.
function test(n){var a=document.forms["n"].rn.value;}
function test(n){var a=document.forms["n"].r+n.value;}
function test(n){var a=document.forms["n"].r+n+.value;}
function test(n){var a=document.forms["n"].r+"n"+.value;}
function test(n){var a=document.forms["n"].r"+n+".value;}