0
I am having problems creating a mask with Jquery, because there are rg’s that close with the 'X' type'.
HTML
<input name="rg" class="form-control" id="rg" pattern="^(d{3}\.d{3}\.d{3}\-d{2}" max='11'>
Script
<script type="text/javascript">$(document).ready(function(){
$("#rg").mask("999.999.999-99" || "999.999.999-a");});
</script>
I cannot put the 'or' condition to accept more than one mask as an alternative.
Impossible the CPF to finish in digit. You must be confusing with some R.G. By the formula of the CPF, only numbers are accepted.
– William Aparecido Brandino
is ID same guy...
– Danilo Tiago Thai Santos
RG changes format in each state. It is not that simple. You would have to assemble several combinations.
– Bacco
It’s a CPF or ID mask?
– Randrade
It’s an ID mask
– Danilo Tiago Thai Santos
RG, for a range of reasons, usually has no mask. What is actually used is an expression for formatting, depending on the typing. Your reply, as @Bacco said, is answered at this link: Regular Expression for RG
– William Aparecido Brandino