Add ajaxSubmit reset and clear options

Created on 22 July 2010, almost 14 years ago
Updated 30 January 2023, over 1 year ago

Problem/Motivation

Currently, if I want an form event to clear a form, I have to add JavaScript to make that happen. Custom JavaScript would be unnecessary if we passed the resetForm or clearForm option to the ajaxSubmit function. It could easily be set in the #ajax property of form elements.

Proposed resolution

Apply patch to 8.7.x and backport to 7.x.

API changes

Adds 2 parameters to the AJAX API. No breaking changes.

✨ Feature request
Status

Needs work

Version

10.1 ✨

Component
FormΒ  β†’

Last updated 1 minute ago

Created by

πŸ‡ΊπŸ‡ΈUnited States Darren Oh Lakeland, Florida

Live updates comments and jobs are added and updated live.
  • Needs manual testing

    The change/bugfix cannot be fully demonstrated by automated testing, and thus requires manual testing in a variety of environments.

  • Quick fix

    Very small and simple change. Preferred over Quickfix.

  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • The Needs Review Queue Bot β†’ tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

    Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

    Consult the Drupal Contributor Guide β†’ to find step-by-step guides for working with issues.

Production build 0.69.0 2024