When you use form.submit() you should use the $$Return field on the form to redirect the user back to your “thanks” form.
If you have a Web Query Save agent assigned to the form you are submitting you can also redirect the user to your thanks form using the “Print [ …url…]” syntax.
You shouldn’t be redirecting the user in the way you are trying as you have no idea whether the form.submit() is actually successful or not