Currency - Visually display the difference between $0.00 and NULL
Would like to support currency values of $0, NULL (no value) and valid amounts and have it displayed so the user can tell the difference between a value of $0.00 and NULL (no value).
Ideally, when a null is stored the control should be blank when the focus leaves the control (its OK if the mask shows $0.00 on focus/hover).
When a $0 is stored the control should show $0.00 (even when not hovered or focused) - as it does with a valid amount ($1.00).
http://jsfiddle.net/a4uhkh5p/1/
@MS37 ,
I totally agree, but the current implementation of the numeric alias does not allow it. Once I can remove the postFormat fn from the numeric alias, I will implement it.
Sounds good. Thanks!
Hi, I don't know if it is bad posting this here, but i have the same question and tough opening a new issue would be a bit double. I saw there was great progress on milestone 3.2 any thoughts on when this will be possible or maby a temporarily workaround?
Thanks, Ricardo
Hi
Sorry to spam this issue but as with silent kill am after a workaround. I've tried extending the onUnmask call locally to my use of the currency alias and this works some of the time but unfortunately falls over as soon as you use back space to clear the value in the input.
any ideas would be gratefully received.
cheers
Sorry i also tried extending and ran into more problems, unfortunately i didnt had any time to look in to it any further.
I have my mask setup like this although not 100% what i want: mask: '9{0,*}[.99{0,5}]', greedy: false, autoGroup: true, digitsOptional: false,
@MS37 , @sillentkil , @electroholic ,
Can you have a try with the current implementation. Visually it is the same, but the behavior is different and also a 0 input is submitted on postback.
What about the non-visual part? The backend needs to know whether the user entered 0.00 or NULL (no-value). Tested it in current dev and it's still always getting "0.00" instead of "".
EDIT: Should I submit a new issue?
Tested the update. Works beautifully.
Tested the update in d558785.
After entering 0.00, I was not able to enter NULL (no value) anymore.
My settings:
$('#field').inputmask('decimal', {
integerDigits: 7,
digits: 2,
radixPoint: ',',
rightAlign: false,
digitsOptional: false,
placeholder: '0',
allowMinus: false,
allowPlus: false
});
Thansks, Mauricio