I have a javascript function as follows:
function myfunction(form Name,formField) {
parseInt(docume nt.formName.for mField.value) +=1;
}
Then I can call the function when needed like this:
myfunction(user s,username);
Here is my problem:
Javascript does not evaluate the arguments passed to the function.
Instead, it tries to use the arguments literarilly.
So instead of this:
parseInt(docume nt.users.userna me.value) +=1;
javascript is actually looking for this:
parseInt(docume nt.formName.for mField.value) +=1;
I have also tried the following without success:
parseInt(eval(d ocument.formNam e.formField).va lue) +=1;
Any suggestions on how to solve this problem?
function myfunction(form Name,formField) {
parseInt(docume nt.formName.for mField.value) +=1;
}
Then I can call the function when needed like this:
myfunction(user s,username);
Here is my problem:
Javascript does not evaluate the arguments passed to the function.
Instead, it tries to use the arguments literarilly.
So instead of this:
parseInt(docume nt.users.userna me.value) +=1;
javascript is actually looking for this:
parseInt(docume nt.formName.for mField.value) +=1;
I have also tried the following without success:
parseInt(eval(d ocument.formNam e.formField).va lue) +=1;
Any suggestions on how to solve this problem?
Comment