Hi There,
I am trying below code to validate my phone number on CRM form, but it keeps giving me the attached error. I am writing my code down. its giving the result that I  want but I am getting the attached error on introducing the regular expression in my code.
function ValidatePhoneNumber() {
var mobilenumber = Xrm.Page.getAttribute("mobilephone").getValue();
if (mobilenumber != null && mobilenumber != undefined) {
var phoneno =^\d{10}$/;
if(mobilenumber.test(phoneno)){
alert("valid");}
else{
alert(mobilenumber );}
}
}

  
                            
                         
                        
                        
                            
                            *This post is locked for comments
                            
                            
                            
                            
                            
                            
                                I have the same question (0)