Hi, i need to make custom masks for dome fields, for brazilian documents, like:
1- CPF
- 11 sequentially numbers stored widhout mask, like: 11111111111
- The mask : ###.###.###-##
- Number masked: 111.111.111-11
2- CNPJ
- 14 sequentially numbers stored widhout mask, like: 11111111000111
- The mask : ##.###.###/####-##
- Number masked: 11.111.111/0001-11
3- Brazil Phone Number
- 14 sequentially numbers stored widhout mask, like: 11111111000111
- The mask : (##) ####-####
- Number masked: (64) 9285-7651
Notes
#1 - In some states, we have phones with a 5 digit prefix, then the mask turns on (##) #####-#### and i really don't know how to do these changes on appgini.
#2 - I am working with an existing database and the 3 types of fields (cpf, cnpj and phones) are text fields with 11, 14 and 11 chars respectively.
Can you help me?
How to implement Custom Mask for text fields?
-
- AppGini Super Hero
- Posts: 85
- Joined: 2014-06-14 03:08
- Location: India
- Contact:
Re: How to implement Custom Mask for text fields?
Use magic hooks.
(Tablename-dv.js) and put the following code in it.
$("#number").mask("9999.999.999-99 ");
Example: http://jsfiddle.net/ZYH9f/345/
(Tablename-dv.js) and put the following code in it.
$("#number").mask("9999.999.999-99 ");
Example: http://jsfiddle.net/ZYH9f/345/