I'm taking my first steps in vbcode and js so i make lots of stupid mistakes and this must be another one.

In a form i have a button that when pressed calls a function like this:

Function1(this.form)

The funcion header is something like this :

Function1(theform)

in the end this function outputs to a text area in the form, like this:

theform.textarea1.focus()

Now, i want to use this function with more than one text area, depending on the call so i tried something like this:

Call:function1(this.form,textareaname)
Header:function1(theform,thetextarea)
Output:theform.thetextarea.focus()

But i get this error: 'thetextarea' is null or not an object.

Can someone help me with this?

Thanks.