mask CPF e Tel

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
wferreira
Posts: 6
Joined: 2018-09-14 01:18

mask CPF e Tel

Post by wferreira » 2019-02-07 13:25

how to put mask for cpf and tel?

pböttcher
AppGini Super Hero
AppGini Super Hero
Posts: 486
Joined: 2018-04-01 10:12

Re: mask CPF e Tel

Post by pböttcher » 2019-02-08 21:57

Hi,

what do you try to acheive. Can you make an example?

wferreira
Posts: 6
Joined: 2018-09-14 01:18

Re: mask CPF e Tel

Post by wferreira » 2019-02-15 16:53

good afternoon!

It would be so for phone (xx) xxxxx-xxxxx

Cpf: xxx.xxx.xxx-xx

When the user enters the mask is ready

sjohn
Veteran Member
Posts: 80
Joined: 2018-05-23 09:32

Re: mask CPF e Tel

Post by sjohn » 2019-02-16 15:26

Was it not possible for you to use the built-in format option? Eventually add/edit date formats?
format.jpg
format.jpg (37.29 KiB) Viewed 328 times

peebee
AppGini Super Hero
AppGini Super Hero
Posts: 209
Joined: 2013-03-21 04:37

Re: mask CPF e Tel

Post by peebee » 2019-02-17 22:29

This jquery mask also works extremely well and includes input validation. I use it myself.

https://github.com/RobinHerbots/Inputmask

Can be loaded with hooks.

Call the jquery.inputmask.bundle.js in your hooks/header-extras.php

and include the jquery Inputmask function in your hooks/tablename-dv.js

You can even add jquery UI widgets (datepicker etc) to what would otherwise be a text field.

Just use the field <id> as the selector. The plugin is comprehensive, has good usage instruction and plenty of examples.

Example:

Code: Select all

$j(document).ready(function(){
  $j(#yourfield).inputmask("99-9999999");  //static mask
  $j(#yourfield).inputmask({"mask": "(999) 999-9999"}); //specifying options
  $j(#yourfield).inputmask("9-a{1,3}9{1,3}"); //mask with dynamic syntax
  $j('#dob').datepicker({
  dateFormat: 'dd/mm/yy',
  yearRange: '-100:+0',
  changeMonth: true,
  changeYear: true
}).inputmask('dd/mm/yyyy');
});

Post Reply