G
Galsaba
I am afraid I did not phrase my question right, so I changed it.
Here is my question:
I want to use checkForm function for 10 forms I have.
form1, form2....., form10.
How can I pass argument to
....
if (document.formX.firstName.value='John')
....
(formX will be form1 or form2, ...or form10 etc.)
function checkForm(A,B)
{
if (document.formX.firstName.value='John')
{
document.formX.amount.value=A
}
else
{
document.formX.amount.value=B
}
}
In the form I call the function by
onSubmit = checkForm(3,4)
Thanks,
Joe
Here is my question:
I want to use checkForm function for 10 forms I have.
form1, form2....., form10.
How can I pass argument to
....
if (document.formX.firstName.value='John')
....
(formX will be form1 or form2, ...or form10 etc.)
function checkForm(A,B)
{
if (document.formX.firstName.value='John')
{
document.formX.amount.value=A
}
else
{
document.formX.amount.value=B
}
}
In the form I call the function by
onSubmit = checkForm(3,4)
Thanks,
Joe