function phonenumber()
{
var a=Xrm.Page.getAttribute( "ccs_phoneno").getValue();
var reg = /^.*(?=.{10,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%^&+=]).*$/;
var K = reg.exec(a);
if (!K)
alert("phone number is valid");
else
alert("phone number is not valid");
var email = Xrm.Page.getAttribute( "ccs_email_id").getValue();
var reg = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
var OK = reg.exec(email);
if (!OK)
alert("Email Address isn't valid");
else
alert("Email Address is valid");
}
{
var a=Xrm.Page.getAttribute( "ccs_phoneno").getValue();
var reg = /^.*(?=.{10,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%^&+=]).*$/;
var K = reg.exec(a);
if (!K)
alert("phone number is valid");
else
alert("phone number is not valid");
var email = Xrm.Page.getAttribute( "ccs_email_id").getValue();
var reg = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
var OK = reg.exec(email);
if (!OK)
alert("Email Address isn't valid");
else
alert("Email Address is valid");
}
No comments:
Post a Comment