Mask Percentage and Money field using only number?

Asked

Viewed 8,227 times

0

I have an html page made for mobile, I would like to put 2 types of mask being % Percentage and R$ Money but I need this field to be type="number" to show the cellular numeric keyboard. I’ve downloaded several masks and none I could make work that way, could help me please?

  • I’ve never seen anything like this, nor in text type input. What’s the problem with placing at the end of the label (%) or (R$). Type: "Enter the value(R$)" or "Enter the value in real"? This is usually how it is done. What you want to do is inject an invalid character into a field that restricts content. I’m pretty sure that’s impossible. On the W3C website it is clear "The <input type="number"> is used for input Fields that should contain a Numeric value."

2 answers

1

  • I had already seen this plugin, it would even work but I need to appear the keyboard phone number example in this image -> http://i.stack.Imgur.com/2QTO0.png

  • to activate the numeric keypad, simply enter the attribute Pattern: <input type="text" class="money2" pattern="[0-9]*">

0

Ever tried to use:

<input type="number" step="0.01" min="0" >
  • I would like to mask, for example when typing it go formatting ex: R $ 10.000,63 or 47,05%

Browser other questions tagged

You are not signed in. Login or sign up in order to post.