Needs work
Project:
Clientside Validation
Version:
4.0.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
2 Mar 2018 at 22:38 UTC
Updated:
24 Nov 2025 at 18:38 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
piggito commentedPrevious patch applied for 8.x-1.x branch on git repository but not for 8.x-1.x-dev then I'm attaching a new patch for this version.
Comment #4
piggito commentedFixing missing import for
Comment #5
mroycroft commentedThis is a really great and needed feature, thanks for the patch! I did take a look at these patches, and I've put together a new one that builds off the first one. Patches https://www.drupal.org/files/issues/2018-05-02/allow_select_affected_for... and https://www.drupal.org/files/issues/2018-05-02/allow_select_affected_for... didn't apply for me unfortunately.
Most of the changes are just fine tuning, but I also included the user login form under the list of general forms. This seemed like an appropriate addition to include. The weights are added in case someone wants to add more items to this list via form alter, this makes it easier to add new form IDs to a particular category of form.
I don't use webform module, so I have no feedback there. But I've made changes to other areas of the first patch where I thought improvements could be made.
Here's a patch and interdiff.
Comment #6
mroycroft commentedComment #8
miiimoooComment #9
mroycroft commentedIs this tagged as needs re-roll for allow-select-affected-forms-2949540-5.patch ? As far as I can tell it applies cleanly, and there's been no new commits made since this patch was provided. Moving back to needs review unless there really is an issue applying allow-select-affected-forms-2949540-5.patch . I recognize some of the earlier patches didn't apply, but to me it doesn't make sense to ask to re-roll those earlier patches, as there was additional work needed on those patches anyways.
Comment #10
mroycroft commentedComment #11
miiimooo@mroycroft - my mistake - I misread the bot message
Comment #12
nikunjkotechahi @piggito, @mroycroft,
Possible to split the work into two patches?
1. Add feature / admin form to allow configuring which forms client side validation should apply to.
2. Add new submodule for webform and add webform related customisation there.
I respect the decision by maintainers but see its high usage for webform we can go for sub-module which can be maintained by webform users. And I can work (when time permits) to fix webform related stuff there instead of disturbing the main module.
Comment #13
nikunjkotechaComment #14
kevin.dutra commented@nikunjkotecha
Here is the patch minus the webform specific stuff.
Were you thinking that the webform pieces should live in a submodule of Webform, or a submodule of Clientside Validation?
Comment #15
nikunjkotechaI would prefer a separate module itself, bridge between two where users of both can contribute and maintain.
sequence type boolean seems wrong here, IMO it should be string, can you confirm?
Also, to make it more generic I would add checks on both form_id and base_form_id, many webform/commerce related forms would be difficult to cover with just form id.
Last thing, can you add some tests for this? TIA.
Comment #16
nikunjkotechaComment #17
rahulrasgon commentedRerolled #5 for 3x branch
Comment #18
l_vandamme commentedI rerolled the patch against the 3.0.0-rc4 version just to have another opinion on the functionality:
Comment #19
nginex commentedPatch #18 works for me
Comment #20
saso.sotlar commentedUpdated patch from #18: fixes notice / warning that shows up in some cases.
Comment #21
nikunjkotechaHi Laurens, Alex, Sašo and all involved here, below is how I would love to see we move forward to have these things merged.
Comment #22
nikunjkotechaComment #23
themodularlabFYI, I'm currently building a site on acquia that uses Site Studio and just discovered that clientside validation seems to be preventing site studio admin component forms from saving, submitting, etc. The patch on #20 actually solved my issues. I also have webform clientside validation submodule enabled and between the patch and that module, I'm able to use clientside validation on all my webforms but it no longer breaks site studio forms. I see there's still a debate on how to handle these changes but just offering a solid thumbs up for the most recent patch as well as hoping to see this feature in a future release. Thanks!
Comment #24
jzavrl commentedUpdated the latest patch here as when you are using AJAX of Webforms, once the form is reloaded the
#after_buildis not in the$formarray anymore and the if statements return an error and break the AJAX callback.Comment #25
jwilson3Comment #26
al0aRerolled the patch of #24 so it applies on the 4.0.x version.
Comment #27
al0aSorry, Previous patch didn't contain everything.
Comment #28
loze commentedApplied the patch to 4.x and it appears to be working as advertised.
One suggestion, I think it would be better if instead of a checkbox to enable on all forms it was radio buttons
[] Add to all forms except those listed
[] Add to only the forms listed
In my case there are only a few forms I want to disable it on, so listing every possible form I want it on for would be difficult, plus I don't want to have to update the list when new forms are added to the site.
Comment #29
xurizaemonCopying NW tasks from #21 to ID.
Comment #30
xurizaemonComment #31
edmund.dunn commentedI rerolled this to move the menu link from config->system to config->user interface. Also had to move the setting.yml file into the config/install directory to prevent an error when installing the module.
This works well for our needs.
Comment #32
edmund.dunn commentedComment #33
edmund.dunn commentedComment #34
ludo.rPatch #31 seems to work on our side (Using version 4.1.0).
I also agree with suggestion in #28, to have both options (white/black-list).
Comment #36
skyriter commentedI created a separate issue specific to exceptions, building off of the the most recent work done for this issue: https://www.drupal.org/project/clientside_validation/issues/3495738#comm...
Comment #37
skyriter commentedI should note that we have tested patch #31 and it appears to be working without issue.
Comment #39
skyriter commentedI have added the patch file, but even though this is working on my local and in our testing environment, I'm getting a PHPUnit error that I do not understand. If anyone could help with this, I'd appreciate it.
Comment #40
skyriter commentedNow that I've updated the config that gets installed, the tests are passing.
Comment #42
skyriter commentedAdding the newest patch, after the issues identified by coderdan were resolved.
This patch removes any mention of webform.
Comment #43
j-barnes commentedUpdated the latest patch to include a small change to allow for patterns similar to how config ignore works. We encountered a use case where enabling client-side validation for all webform submissions was necessary. However, manually adding hundreds of form IDs was impractical.
Example:
Comment #44
asherry commentedHi all. I'm late to the party and definitely not an authority on this project but we're having a major issue with this module breaking layout builder forms after setting the jquery validate library to trigger before ajax submit.
The latest code in this ticket (which I'm assuming is in #43) isn't completely working for us because it doesn't actually change the behavior of the jquery validation library.
I created a patch to get our site working temporarily but it really only accounts for our specific use case. Here is an overview of what's in the patch. I also included a few questions that might help me understand how to get to a real solution that fixes all use cases.
clientside_validation_jquery/js/cv.jquery.validate.jswhich works for our use case but I'm sure isn't going to work for sub elements or other validation implementations that aren't jquery