Hi, I was trying to adjust the configuration of the Clientside Validation module and ran into the same issue - I expected the class 'cv-validate-before-ajax' to cause a change in behaviour when add to the form, not an element. This is because on the configuration page for Clientside Validation jQuery it says "All forms with class "cv-validate-before-ajax" will be validated by default".
When I went looking for more information, I found the issue where this was worked on β , where I felt the discussion also implied that the class should be applied to the form. It wasn't until I found this issue that I realised that it just doesn't work that way.
For me, it would be preferable to the class to trigger the expected behaviour when attached to the form. I would find it very useful for the feature to work as described.
- πΊπΈUnited States inversed
This patch fixes the specific issue I'm having, but it would break backwards compatibility with existing sites. I think the right solution would be to:
- Adjust the patch to support either
$form
orelement
- Adjust the admin page help text to indicate how this works
- Adjust the patch to support either
- πΊπΈUnited States inversed
inversed β changed the visibility of the branch 4.0.x to hidden.
- Merge request !31Issue #3260653 by khiminrm, inversed: Allow pre-submit AJAX validation control by element or form class β (Open) created by inversed
- πΊπΈUnited States inversed
I created a Merge Request for this and you can download a patch from the diff if needed. Per the comment in #6, this makes the manually controlled pre-submit validation for AJAX submits check for the opt-in class in either the form or an element. It also updates the help text and the schema description to match.
I did this against the 4.0.x branch as that is the current version. I updated this ticket accordingly.