I have not written up a test to verify this, but I suspect that your problems is that the code following "Ok" is calling submit() on a full jQuery object of the form -- which has the validation script attached to it, so it gets caught in an endless loop.
What you really want to do is to call the submit() function on the FORM itself, not the jQuery object containing the form. So $("purchase_credit").get(0).submit() should do the trick. The get(0) returns the plain DOM version of the form, so it no longer has any validation stuff attached to it. The fact that, with jQuery, $("form").submit() and form.submit() don't always behave identically is a bit confusing... spud.