Hello everyone my name is Taniguchi, the id document you use in your country in mine is named "CPF" and i have a code to put a mask in the ID but i have trouble to understand some parts.
function maskCPF(executionContext) {
var attribute = executionContext.getEventSource();
var cpf = attribute.getValue();
cpf = cpf.toString();
cpf=cpf.replace(/\D/g,"");
cpf=cpf.replace(/(\d{3})(\d)/,"$1.$2");
cpf=cpf.replace(/(\d{3})(\d)/,"$1.$2");
cpf=cpf.replace(/(\d{3})(\d{1,2})$/,"$1-$2");
Xrm.Page.getAttribute("crd4c_cpf").setValue(cpf);
}
what the meaning of this parts:
cpf=cpf.replace(/(\d{3})(\d)/,"$1.$2");
cpf=cpf.replace(/(\d{3})(\d)/,"$1.$2");
cpf=cpf.replace(/(\d{3})(\d{1,2})$/,"$1-$2");
*This post is locked for comments
I have the same question (0)