Blog Sections Open

Making ajaxSubmit and eForm Work Together Reliably

A practical AJAX form pattern for Evolution CMS projects that still rely on eForm but want a smoother frontend submission flow.

ajaxSubmit plus eForm can work well together, but only if both sides agree on what a successful response looks like. Otherwise the frontend expects a simple success token while the server keeps returning full HTML, validation markup, or partial form output.

Typical pattern

[[ajaxSubmit? &form=`#feedbackForm` &msgElem=`div.error` &succesMessage=`Sent.`]]
[!eForm? &vericode=`0` &to=`manager@example.com` &formid=`feedbackForm` &tpl=`feedbackForm` &report=`feedbackReport`!]

The JavaScript then posts serialized form data back to the current page and swaps the form block depending on the response.

What usually breaks

  • The frontend expects a literal success response, but eForm returns rendered HTML.
  • Validation errors replace the form incorrectly because the wrapper element is inconsistent.
  • Rebinding is missing after the first AJAX-rendered response.

Better rule

Pick one response contract and stick to it. Either always return HTML fragments and re-render the form region, or return a machine-readable success state and handle messaging fully in JavaScript.

The less mixed the responsibilities are, the easier it is to keep AJAX forms stable in older Evo projects.

Newer post

Sorting pdoResources by Integer TV Values Correctly

How to avoid wrong sort order in pdoResources when numeric TV values are being sorted as plain strings instead of integers.

Older post

Getting a Full List of Users Programmatically in Evolution CMS

How to fetch all users programmatically in an Evolution CMS project when you need to process user data in PHP instead of through the manager UI.