Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Submit Indicator

Security covered Under active development 2 sites

This module adds visual loading indicators to standard Drupal form submits, similar to how AJAX forms behave. It helps prevent accidental double submissions by showing feedback while the form is being processed on the server, and offers customizable spinner, throbber, or fullscreen loading animations.

Loading indicators for non-AJAX form buttons

AJAX forms in Drupal show a progress indicator while they work. This module does the same for ordinary form submissions: the button shows that the form is submitting, and a second submit is blocked until the page loads.

Three indicator types:

  1. A spinner on the button
  2. Drupal's AJAX throbber next to the button
  3. Drupal's AJAX fullscreen progress indicator

Configuration

  1. Install and enable the module
  2. Visit Admin / Config / User Interface / Submit Indicator
  3. Choose your default indicator type (spinner, throbber, or fullscreen)
  4. Done - every non-AJAX form now shows feedback on submit

You can also set the indicator per form or per button.

For every setting and theming option, see the README.md.

Features

  • Three indicator types: a spinner on the button, Drupal's throbber next to the button, or Drupal's fullscreen progress indicator
  • Automatic or opt-in: every form by default, or only the forms you list
  • Form API property: #submit_indicator sets the indicator per form and per button (similar to #ajax)
  • Exclusions: AJAX forms are skipped automatically; admin pages, form IDs (with wildcards), and anything with the exclusion class can be left out
  • Theme-friendly: the "disabled" look uses the theme's own disabled button style (Drupal's is-disabled class), with a gray default; spinner color and image are set with CSS custom properties
  • Accessible: buttons are marked aria-disabled without leaving the submitted data, and the spinner slows down for users who prefer reduced motion
  • Client-side validation: the indicator resets when the browser's validation or Clientside Validation stops the submit

How it works

When a user submits a non-AJAX form:

  1. The configured indicator (spinner, throbber, or fullscreen) is shown
  2. A second submit, from any button or the Enter key, is blocked
  3. The form's submit buttons are optionally marked as disabled
  4. If client-side validation fails, the indicator resets immediately
  5. If the form submits, the page loads and the indicator is gone, also when the user comes back with the browser's Back button
  6. A configurable timeout resets the indicator if the page doesn't load

A script that cancels the submit to do its own work first, such as getting a payment token, resets the indicator on an error by dispatching one event:

form.dispatchEvent(new CustomEvent('submit-indicator-reset'));

Usage: #submit_indicator property

// Use the fullscreen indicator for a form
$form['#submit_indicator'] = ['type' => 'fullscreen'];

// Shorthand - just pass the type
$form['#submit_indicator'] = 'throbber';

// Disable for a specific button
$form['actions']['preview']['#submit_indicator'] = FALSE;

// Disable for the entire form
$form['#submit_indicator'] = FALSE;

// Spinner with custom color
$form['actions']['submit']['#submit_indicator'] = [
  'type' => 'spinner',
  'color' => '#000000',
];

Available options

  • type - 'spinner', 'throbber', or 'fullscreen'
  • color - Spinner color; empty uses the button's text color (spinner only)
  • position - 'end', 'start', or 'center' (spinner only)
  • room - Widen the button's padding for the spinner (spinner only)
  • text - Text on the button while the form submits
  • look - 'button' or 'disabled'
  • message - Text shown next to the throbber (throbber only)
  • disableButton - Mark the submit buttons as disabled while the form submits (default: true)

Similar modules

Requirements

  • Drupal 10.1 or later, 11, or 12

Ask your assistant about Submit Indicator

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
Jan 2026
Latest release
14 hours ago
Releases (12 mo)
3 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Core PHP Release date
1.0.0-alpha2 Pre-release 10–11 Nov 29, 2026
1.0.0-alpha1 Pre-release 10–11 Nov 26, 2026
1.0.x-dev Dev 10–11 Jan 18, 2026