Notifications
Announcements
No record found.
how to perform validation of email id or any fields using javascript or jQuery ..!!
*This post is locked for comments
Hi Ram,
As suggested by Guido, use onchange event to run some validation code. You can use regex to validate email. See example below.
www.w3resource.com/.../email-validation.php
Cheers,
Nadeeja
Here is an article that provides an example for you as well.
abhishekserjam.wordpress.com/.../crm-2013-form-field-formatting-through-javascript-6-email-field-validation
Hope this helps!
Thanks,
Hi,
You can write the following code in javascript to validate email address in dynamics crm.
function EmailTest(EmailField) { var Email = /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9_.-]+\.[a-zA-Z]{2,}$/; if (Email.test(EmailField)) { return true; } else { return false; } } function CheckEmailString(context) { try { var EmailString = Xrm.Page.getAttribute("emailaddress1").getValue(); if (EmailString != null) { var Flag = true; if (!EmailTest(EmailString)) { Flag = false; } if (Flag != true) { alert("Please check if the email might contain invalid format. Note that only one email address is allowed for this."); } } } catch (err) { alert(err.message); } }
See the below article to validate the email address. A video clip is also provided to explain how to add the code in crm and its complete working
softchief.com/.../email-address-validation-javascript-dynamics-crm
The following JavaScript shows how to validate email address using Regular Expression . function validateEmail(inText){ const re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; var email=document.getElementById(inText).value; if(re.test(String(email).toLowerCase())) { alert("Email is valid : " + email); } else { alert("Email is not valid : " + email); }}
Hi RamKumarb
Kindly go through the provided links below
www.upgrad.com/.../
stackoverflow.com/.../how-to-validate-an-email-address-in-javascript
https://youtu.be/tG4xE9ycgsc
Hope it helps!
Regards,
sh012
website: https://www.dynamicslabs.io/
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
SA-08121319-0 4
Calum MacFarlane 4
Alex Fun Wei Jie 2