Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 292695

Ongoing ajax submission prevents full form submission

$
0
0

Problem/Motivation

When using AJAX within a form to perform updates when an element get changed (for example updating when a textfield is changed), Drupal.ajax disables the element and adds the progress-disabled class. If you then submit the form (not via AJAX) before the request finishes, the disabled elements do not get submitted with the rest of the form which can cause all manner of problems.

Proposed resolution

I can see two potential solutions:

  1. Mark the element as readonly rather than disabled so that the value still get's submitted but it can't be edited while processing.
  2. Add a submit() handler to forms that have AJAX elements that remove the disabled attributes from the elements before the submission takes place.

Remaining tasks

  1. Decide which solution (or another alternative) is the best approproach
  2. Implement it...

    Viewing all articles
    Browse latest Browse all 292695

    Trending Articles



    <script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>