I was deploying some InfoPath forms today and testing them out when I stumbled on the not so helpfull error "An error occurred while submitting the form". Luckily SharePoint offers a logging system which allows you tune at what level you want to get error logging. So I went to SharePoint Central Admin > Operations > Diagnostic Logging (Underneath the Logging and Reporting section). Next select the Event Category - Forms Services Runtime and change the Trace Log to Verbose. This showed me that the there was actually an error with the filename of the InfoPath which was composed right before the submit action.
If you want to visualize the SharePoint ULS logs within SharePoint it might be a good idea to install the SharePoint Log Viewer feature from the SharePoint features project on Codeplex. The latest version (build 184.108.40.206) also allows you to open the latest log file (the previous version gave an error that the file was locked.)