jQuery's trigger('submit') omits submit button data, silently breaking backend form checks
A subtle JavaScript behavior causes jQuery's .trigger('submit') to fire a native form submission without a 'submitter', meaning the clicked button's name and value are excluded from the POST body. Many backend frameworks and plugins — including PrestaShop and older WordPress code — determine which action to take by checking for a named submit button in the POST data, so if that key is absent, the relevant code branch never executes. The failure is especially hard to diagnose because no error is thrown, no validation message appears, and server logs show nothing unusual; the page simply reloads as if no submission occurred. The issue was confirmed on PrestaShop 9.1.4, where contact form submissions silently dropped without storing messages or sending emails. The recommended fix is to manually re-attach the submit button's name and value as a hidden input before programmatically submitting the form.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in