Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 82002

Phone validation

$
0
0

Hi There,

I have applied phone validation on my lead form  using java-script and its working fine but the problem is as I do ok on alert(phone number invalid) the forms get save, i have applied Javascript on save of from. Below is the code that I have wrote.

function ValidatePhoneNumber() {
var mobilenumber =Xrm.Page.getAttribute("telephone1").getValue();
if (mobilenumber !=null && mobilenumber !=undefined) {
var phoneno =/^(\+?)(1?\s?)\d{10}$/;
if(!phoneno.test(mobilenumber)){
alert("phone number invalid");}
}
}


Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images