What I mean is, you somewhere have a function getsub().
User clicks button, with onclick set to getsub. Your function is called. Form is not submitted. It's a button, not a submit.
However, if getsub does a form submit itself, then the form will be submitted. And what happens then, is that getsub is executed. A second time! Why?
On the other topic, I'm not talking about what data you have. I'm talking about what's NOT a part of the object representing the dom node for an input element. Neither myform_sub18 nor myform_sub19 are parts of this object, so when you have
onclick="getsub(this.myform_sub19);"
What it will evaluate to is
getsub(undefined);
this.type, this.name, this.id, and many many others would all be defined and actually have some kind of value.