Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Currently all forms are ajaxified.
It would be awesome to have the ability to configure this
- Either fully disabled
- Target on specific form ID's
Not sure what option is best, will try to come up with a patch as soon as I have some time.
Comment | File | Size | Author |
---|---|---|---|
#3 | ajax_pages-exclude_ajax_process_on_submit_button-1996176-1.patch | 2.19 KB | OwilliwO |
Comments
Comment #1
jamix CreditAttribution: jamix commentedMakes sense, will be happy to review the patch.
Still curious about the forms that are not ajaxified though, perhaps submit a bug for this?
Comment #2
swentel CreditAttribution: swentel commentedWoops, wrong description. Effectively, all forms *are* ajaxified, sorry about that - will update the issue summary :)
Comment #3
OwilliwOHi guys !!
Here is a patch which allows users to exclude some submit buttons.
It add a new textfield in admin form, in which you can type some classes or ids.
This selector is used in javascript to unselect submit buttons in order not to apply them ajax process..
Then, you can add a custom class to submit button (with hook_form_alter) and exclude it easily !
Do you agree with it ?
PS : sorry for my english (french guy..)
Comment #4
jamix CreditAttribution: jamix commentedThanks for the patch! As suggested by swentel in the original post, wouldn't it be better to target form IDs instead?
Comment #5
OwilliwOI prefer exclude buttons, because you can have two submit buttons in one form. For example, login form with gauth button (see https://drupal.org/project/gauth), i keep ajax process on "normal" submit button, but i need "normal" process on google sign in button..
If you really want to exclude complete forms, you can add a new conf field in admin form, to list form ids you want to be excluded..
Comment #5.0
OwilliwOUpdated issue summary.
Comment #6
jamix CreditAttribution: jamix commentedOK, a few thoughts here.
First, using
hook_form_alter()
to add special classes to the submit buttons wouldn't be necessary if we are going to be able to enter selectors like#article-node-form #edit-cancel
in the exclusion field. (Using#article-node-form input[type="submit"]
would disable Ajax pages on all buttons inarticle_node_form
, which would address the original request.)Second, it may make sense to let the user enter selectors one per line as opposed to separating them with commas.
Third, the field should probably also allow to target
<a>
links for exclusion.