Browse AjaxPress docs

Forms

On this page

With AjaxPress, forms submit without a full page reload, just like links: search, comments, filters, logins, WooCommerce forms, and simple contact forms. The result page appears the same way any other page does, with your loader and transition. There’s nothing to set up.

Search and forms submit without a page reload, and the radio keeps playing.

How it works

When a visitor submits a form, AjaxPress sends it in the background with the same method (GET or POST), the same fields, and the button that was clicked. That last part matters for forms with more than one submit button, such as Update cart and Proceed to checkout: the server still knows which one was pressed.

The page the server answers with is shown in place of the current one, and the address bar updates to match.

Forms AjaxPress leaves alone

A form submits the normal way, with no involvement from AjaxPress, when:

The form…Why
is already submitted over ajax by its own pluginMost contact form plugins do this. AjaxPress sees the plugin has handled the submit and stays out of the way
has a file upload fieldFile uploads need a real submission
submits to another website, to wp-admin, or to an excluded addressSame rules as links
has target="_blank", _top or _parentIt’s meant to open elsewhere
is a login or registration form, and Full Page Reload on Login & Registration is onYou asked for a real page load at sign-in
has the data-ajaxpress-ignore-submit attribute, or sits inside an element that has itYou opted it out (see below)

Opt a form out

Add data-ajaxpress-ignore-submit to a form, or to any element around one or more forms, to leave them to the browser:

<form action="/subscribe" method="post" data-ajaxpress-ignore-submit>…</form>

<div class="payment-area" data-ajaxpress-ignore-submit>
  <!-- every form in here submits the normal way -->
</div>

Use this for a single form whose plugin needs a real page load, when you’d rather not exclude the whole page.

In a page builder, add it as a custom attribute on the form widget or its section: in Elementor, Advanced → Attributes (Elementor Pro); in Bricks, the element’s Attributes. Enter the name data-ajaxpress-ignore-submit and leave the value empty.

Logins and registration

Sign-in, registration and password forms submit without a reload by default, on wp-login.php, WooCommerce My Account, and anywhere else. A failed login shows its error in place. See Full Page Reload on Login & Registration for sites whose sign-in needs a real page load.

  • Form plugins: Contact Form 7, WPForms, Gravity Forms, Fluent Forms and builder forms
  • Form problems: a form submits twice, stops before its message, or loses its data