Needs review
Project:
Clientside Validation
Version:
4.0.x-dev
Component:
Field Validation
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
14 Dec 2022 at 15:43 UTC
Updated:
2 Sep 2025 at 12:43 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #3
grimreaperUploading patch for easier composer usage.
Thanks for the review!
Comment #4
j. commentedThank you for the patch. I was having issues with forms submitting with email adress just like that and triggering wierd errors on the server side. This fixed it.
I am using drupal 9.7 and php 7.4.
Comment #5
striknin commentedHi, thanks for this usefull patch.
But what about email addresses with subdomain, like XXX@sub.domain.ext ?
We need to allow repeated segments with dots, after the @.
So, by changing the regex by the one proposed in this new patch, the validation passes for email addresses with subdomain.
Comment #6
grimreaperHi,
@Striknin, thanks for the patch, this is a case I am encountering on my project too.
But with this patch, xx@xx is now valid again which was the original point of the issue.
I will update the MR.
Comment #7
grimreaperThis is regex from Jquery library:
This is the new proposed one:
I removed the "?" to have a first domain part. And changed the "*" to "+" to have any depth of subdomains. But with at last a first level.
xxx@xxx => FALSE
xxx@xxx.xxx => OK
xxx@xxx.xxx.xxx => OK
etc.
Comment #8
grimreaperUploading patch for Composer usage.
Comment #9
striknin commentedHello,
@Grimreaper you're absolutely right! My bad, I didn't re-check after changing the regex ...
It's now perfect, thank you !
Comment #10
grimreaper@Striknin, thanks to have re-tested.
Changing to RTBC regarding comment 9.
Comment #11
nigelcunningham commentedWould it be feasible to make the change optional? Sometimes, such as when testing in the context of a local development environment, you might validly want to just enter user@localhost.
Regards,
Nigel
Comment #12
nikunjkotechaI agree, changing the validation should be based on configuration.
Comment #14
sakthi_dev commentedMade the jquery over ride based on config. Please review.
Comment #15
nikunjkotechaFeedback on MR
Comment #16
dhruv.mittal commentedComment #17
dhruv.mittal commentedPlease review
Comment #18
nikunjkotechaThanks for the updates Dhruv, can you please check code formatting issues?
Comment #19
grimreaperComment #20
grimreaper