Posts

Showing posts from April, 2016

Multiple Email address Validations using Regular Expression in JQuery

Multiple Email address Validations using Regular Expression in NewForm.aspx and before saving the item. 1) "To", CC, BCC  address are Multiline of text field with Plain text type aloow =================================================================== function PreSaveAction() { var emailReg = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i; var To_emailaddressVal = $("textarea[title$='To Required Field']").text(); var Cc_emailaddressVal = $("textarea[title$='Cc']").text(); var Bcc_emailaddressVal = $("textarea[title$='Bcc']").text(); var To_emails=To_emailaddressVal.split(';'); var Cc_emails=Cc_emailaddressVal.split(';'); var Bcc_emails=Bcc_emailaddressVal.split(';'); //For loop for each email address in To for (i = 0; i < To_emails.length; i++) {  if(To_emails[i].trim()!="")  {    if(!emailReg.test(To_emails[i]....