Mobile angle keypad

0

Hello, I'm developing an angled form that will be used both desktop and mobile.

However, I would like numeric fields such as CPF, Phone, Cep in the mobile to display only the numeric keypad, not the full keyboard!

How can I do this? Remember that I can not put the type: number in the input, because I use masks in these fields, and the type number input would not let me use these masks ..

Thank you in advance ...

    
asked by anonymous 07.08.2018 / 20:30

1 answer

1

Just change the type attribute in the input.

<input type="number"/>

or

<input type="tel"/>

EDIT:

<!DOCTYPE html>
<html>

  <head>
    <link rel="stylesheet" href="style.css" />
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.js"></script><scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/jquery.mask/1.14.15/jquery.mask.js"></script>
  </head>

  <body>
    <input id="CPF" type="tel" />

    <script>
      var cpf = $("#CPF");
      cpf.mask('000.000.000-00', {reverse: true});
    </script>
  </body>

</html>

    
09.08.2018 / 20:34