0
one of the solutions is to use a Pattern in the input field
follows an ex:
<input type="number" pattern="^[R$\-\s]*[\d\.]*?([\,]\d{0,2})?\s*$" />
this validates the following entries
1 => true
1,00 => true
R$1 => true
R$1000 => true
0,1 => true
1.000,00 => true
R$1.000.000 => true
5678 => true
and invalidates these other
1,001 => false
02,0 => false
22.42 => false
001 => false
192,168,1,2 => false
. => false
,55 => false
2000.000 => false
also you work with the mask of the field to force the use of this data.
Possible duplicate of Remove currency formatting and take only the PHP number
– Daniel Omine
Have you seen the plugin
maskedinput
jQuery? http://digitalbush.com/projects/masked-input-plugin/#Usage– Leonardo Pessoa
Yes, but since I already used Jquery Price... but still this validation is only client side
– Thiago