the client side validation references the form using the document.forms[x] collection where x is the index of the form to validate. each form on the page is given a number index, the first for is 0, the second form is 1 and so on.
this client side code was generated for the first form on the page using:
most likely, you added client side validation to the form, then added the second form. but since the second form was added to the page before the checkout form that you are validating, it broke the client side validation, because that second form is now before the original one in the DOM.
I dont recommend using client side validation. I recommend using server side validation instead.
your checkout form posts to the card_confirm.php page, so the server validation behavior will need to be applied there.
see this thread for details on adding server validation to a checkout form like yours: