dragonturtle
Programmer
Hi,
I have a form in page that looks something like this:
The calculateForm() function needs to take the parameter and append it to the name of the field, but I can't figure out how to do it.
Any help is appreciated. Thanks.
I have a form in page that looks something like this:
Code:
<form name=myForm>
<input type=text name=value1 onBlur=calculateForm(1)>
<input type=text name=result1>
<input type=text name=value2 onBlur=calculateForm(2)>
<input type=text name=result2>
<input type=text name=value3 onBlur=calculateForm(3)>
<input type=text name=result3>
</form>
The calculateForm() function needs to take the parameter and append it to the name of the field, but I can't figure out how to do it.
Code:
function calculateForm(num)
{
var d = document.myForm;
d.result+num.value = d.value+per.value;
}
Any help is appreciated. Thanks.