1
The RG mask comes with a different pattern in which I need!
RG code:
function Rg(v){
v=v.replace(/\D/g,"");
v=v.replace(/(\d)(\d{4})$/,"$1.$2");
v=v.replace(/(\d)(\d{4})$/,"$1.$2");
v=v.replace(/(\d)(\d)$/,"$1-$2");
return v
}
in that code he plays the RG with the pattern: 88888.888-8
And the pattern I need is : 88.888.888-8
Thanks for the other answers. And I would like to add a question:
"You can use a if
at the time of typing to check both numbers reported to standardize on the function?"
Hello, look at this link it shows a Masked input exactly the way you need it. Masked Input
– f.fujihara
Thanks for the info, but that’s not exactly what I need!
– Bruno
Dude, I don’t know why you want it in this format, but... The amount of RG numbers varies, has been having more and less numbers, depending on where the person is, it may not suit this amount of numbers you want to check.
– Marcelo Aymone
It’s expensive ... The problem is that when you are "pawn" you must obey when you are passed a thing!
– Bruno
And this one: http://www.duocriativa.com.br/janela/blog/2012/06/10/application-mascaras-a-campos-de-formulas-com-plugin-jquery
– f.fujihara
I know, but in case, complete with zeros on the left, total can have up to 9 even.
– Marcelo Aymone
Repeated question: http://answall.com/questions/22431/express%C3%A3o-regular-para-rg
– Ronny Amarante