Business email validation #18398
ganatantra-kumar
announced in
Developers Community
Replies: 2 comments 1 reply
-
` <script> -- | var label = 'Email'; | var standardEmail = /^(?!.+@(gmail\|google\|yahoo\|outlook\|hotmail\|msn)\..+)(.+@.+\..+)$/; | var errorMessage = 'field: Please enter your business email address.'; | | document.querySelector("input[name='" + label + "']").addEventListener("input", function(e){ | e.target.value = e.target.value.toLowerCase(); | }); | | window.__custom_form_validations = [ | { | fieldName: label, | validationFn: function (input) { | return { | isValid: standardEmail.test(input.value), | message: window._Translate.get(errorMessage), | }; | }, | }, | ]; | </script> ` |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
With the Below code, I am trying to select the Label Email and make validation. But don't know why this code is not being triggered. Can someone please check and advise.
Note: this is being used in WordPress with Elementor Builder.
The snippet is attached:
Business email validation for Elementor(Wordpress).txt
Beta Was this translation helpful? Give feedback.
All reactions