//do some stuff here to validate
//alert the validation result... shows the alert so there's nothing in the function to that point preventing it from working.
I can't see any reason why that doesn't work.
Note that I've also tried
theform.submit(), but that doesn't work either.
However, if I put a submit button on the form and click that instead, it works.