Forum Moderators: open
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;}
function getFormInput(inputName,formName)
{
if(document.getElementById)
{
return document.getElementById(inputName);
}
else if(document.forms[formName])
{
return document.forms[formName][inputName];
}
else
{
return false;
}
}