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:
- Mark the element as
readonly
rather thandisabled
so that the value still get's submitted but it can't be edited while processing. - Add a
submit()
handler to forms that have AJAX elements that remove thedisabled
attributes from the elements before the submission takes place.
Remaining tasks
- Decide which solution (or another alternative) is the best approproach
- Implement it...