hey, i can't figure out how to submit my form upon a javascript being true.

i've got a button that calls my function:
<input name="submit" type="button" value="Submit" onClick="validCCForm(this.form.ccType,this.form.ccnumber,this.form.expdate)">

the
validCCForm(this.form.ccType,this.form.ccnumber,this.form.expdate)
gives a series of popups if the fuction is false, and does nothing if it is true.


i've got a form that looks like this:
<form method="post" name="form2" action="<?php echo $editFormAction; ?>">

here's what the function looks like (it calls up other functions, but they're irrelevent):

function validCCForm(ccTypeField,ccNumField,ccExpField)
{
var result = isValidCreditCardNumber(ccNumField,ccTypeField.value,"Credit Card Number",true) &&
isValidExpDate(ccExpField,"Expiration Date",true);
return result;
}


what do i need to add to the code to make it go:

document.form2.submit();

if it's true