I need to make a mask to currency values in the following way (Brazilian way of displaying currency values):
- It can only accept numbers (obviously)
- It has to be written from right to left
- A ',' (comma) symbol have to be the separator of the integer and decimal parts
- A dot ('.') have to separate each group of three numbers in the integer part
I tried to use the fieldBuilder default construtor inside a InputMask to set accomplish some of the above points but I wasn't successful. I know that I can choose the direction of typing in a NumberMask, but I couldn't do any more than it. I would be grateful if you can help me.
Thanks,
Leonel
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Now I have another problem. I'm using the NumberMask to make the currency mask just like it is in the example. But it still accepting special characters, such like: ç, ~, ^, ', `, º, ª, etc.
I was wondering if that's because these characters are made of a combination of keys of the keyboard and the javascript functions don't treat than right.
Thanks in advance,
Leonel
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The strange thing is that it only accepts some of the characters you obtain by pressing Shift + key. For example, it accepts the symbol '^' (which is obtained by pressing 'Shift'+'~' in my keyboard) but doesn't accept the symbol '{' (which is obtained by pressing 'Shift'+'['). Furthermore, try to input some symbols in the field results in showing '0,0', which is the case of the parenthesis and '*', for example.
Additionally, it accepts every symbol you obtain pressing the 'Alt' key before.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi there,
I need to make a mask to currency values in the following way (Brazilian way of displaying currency values):
- It can only accept numbers (obviously)
- It has to be written from right to left
- A ',' (comma) symbol have to be the separator of the integer and decimal parts
- A dot ('.') have to separate each group of three numbers in the integer part
I tried to use the fieldBuilder default construtor inside a InputMask to set accomplish some of the above points but I wasn't successful. I know that I can choose the direction of typing in a NumberMask, but I couldn't do any more than it. I would be grateful if you can help me.
Thanks,
Leonel
You should use a NumberMask for that.
Look at http://javascriptools.sourceforge.net/samples/sample_mask.html
Thanks man.
Hey,
Now I have another problem. I'm using the NumberMask to make the currency mask just like it is in the example. But it still accepting special characters, such like: ç, ~, ^, ', `, º, ª, etc.
I was wondering if that's because these characters are made of a combination of keys of the keyboard and the javascript functions don't treat than right.
Thanks in advance,
Leonel
The strange thing is that it only accepts some of the characters you obtain by pressing Shift + key. For example, it accepts the symbol '^' (which is obtained by pressing 'Shift'+'~' in my keyboard) but doesn't accept the symbol '{' (which is obtained by pressing 'Shift'+'['). Furthermore, try to input some symbols in the field results in showing '0,0', which is the case of the parenthesis and '*', for example.
Additionally, it accepts every symbol you obtain pressing the 'Alt' key before.