I have a HTML form with button:
<
That's because you shouldn't just use the submit function, but trigger the submit like:
submit
trigger
$("#MyForm").trigger('submit');