delinear
03-02-2005, 11:30 AM
Hi all,
I'm writing some javascript to do a very basic form validation (just checking for blank fields). The thing is I want a generic function that can be used for many different forms, but in order to do so I need to pass all fields from the relevant form to the function and validate them onclick.
Is there a way to pass several variables as an array or would I have to pass them as a string with a separator and then turn them into an array in the function itself?
I'm writing some javascript to do a very basic form validation (just checking for blank fields). The thing is I want a generic function that can be used for many different forms, but in order to do so I need to pass all fields from the relevant form to the function and validate them onclick.
Is there a way to pass several variables as an array or would I have to pass them as a string with a separator and then turn them into an array in the function itself?