According to the documentation on github a cardinality (Cardinality) defines how many characters represent the definition to be validated.
In your example, the character '*'
represents 1 character that will be validated with regex: [A-Za-záãâÁÂÃéêẽÈÊẼìîĩÌÎĨòôõÒÔÕùûũÚÛŨ ]
Example
$('#elemento1').inputmask({
mask: "*{1,255}",
greedy: false,
definitions: {
'*': {
validator: "[A-Za-záãâÁÂÃéêẽÈÊẼìîĩÌÎĨòôõÒÔÕùûũÚÛŨ ]",
cardinality: 1
}
}
});
$('#elemento2').inputmask({
mask: "*{1,255}",
greedy: false,
definitions: {
'*': {
validator: "[A-Za-záãâÁÂÃéêẽÈÊẼìîĩÌÎĨòôõÒÔÕùûũÚÛŨ ]",
cardinality: 2
}
}
});
$('#elemento3').inputmask({
mask: "*{1,255}",
greedy: false,
definitions: {
'*': {
validator: "[A-Za-záãâÁÂÃéêẽÈÊẼìîĩÌÎĨòôõÒÔÕùûũÚÛŨ ]",
cardinality: 3
}
}
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://rawgit.com/RobinHerbots/Inputmask/4.x/dist/jquery.inputmask.bundle.js"></script>
<input type="text" id="elemento1" />
<p/>
<input type="text" id="elemento2" />
<p/>
<input type="text" id="elemento3" />
As it is in the link: " Cardinality specifies how many characters are represented and validated for the definition"
– Don't Panic
@Everson this yes, but I don’t understand what that means exactly kk
– AnthraxisBR