
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);
}
}
*This post is locked for comments
I have the same question (0)