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

Validation

$
0
0

Hi guyzz .. i have small requirement. i am doing validation for field. I just want to pass the length of the field from Pass execution as first parameter.. But i couldnt get the length.. This is my code. can any one help me out.

function FormatPhoneNo(context,length)
{

var nvsField = context.getEventSource().getValue();
//alert(nvsField)
//var nvsTmp = nvsField;
if (typeof (nvsField) != "undefined" && nvsField != null)
{
//var nvsTmp = nvsField.replace(/[^0-9]/g, "");
if(length == 10)
{
alert("fvf");
var nvsTmp = nvsField.replace(/[^0-9]/g, "");
alert(nvsTmp);
context.getEventSource().setValue(nvsTmp);
}

else
alert("Phone must contain 10 numeric digits.");
context.getEventSource().setValue(null);
}

}


Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images