Skip to content

Javascript input mask

The mask tokens should be defined in lower case and can be used in combination with each other to compose and force different input formats.

<html>
<script src="https://jsuites.net/v4/jsuites.js"></script>
<link rel="stylesheet" href="https://jsuites.net/v4/jsuites.css" type="text/css" />

<input data-mask='U$ #.##0,00'>

</html>
MethodDescription
aAny letter
0Number
0 litersNumber
0%Percentage
#,##0Currency
$ #,##0.00Currency with decimal
$ #.##0,00Currency with decimal
dd/mm/yyyyDate
hh:mmTime
yyyyYear four digits
yyYear two digits
mmMonth
ddDay
hh24Hour 24
hhHour 12
miMinutes
ssSeconds
\aLetter "a" (escape for a)
\0Number "0" (escape for 0)
[-]Number signal (- or +)

A few valid tokens can be used with mask as below:
0
0.00
0%
0.00%
#,##0
#,##0.00
#,##0;(#,##0)
#,##0;Red
#,##0.00;(#,##0.00)
#,##0.00;Red
d-mmm-yy
d-mmm
dd/mm/yyyy
mmm-yy
h:mm AM/PM
h:mm:ss AM/PM
h:mm
h:mm:ss
m/d/yy h:mm
mm:ss
[h]:mm:ss