How to: Use Ajax to submit forms with default actions after submit

I tried this code here – the form successfully pushes data to external system, but always returns error state.

What is wrong? How can I fix that?