Get raw value of field using number mask
See original GitHub issueHello,
I have the following issue: I am using text fields with number mask, of following way: mask='9'
. But I want to consider invalid the empty fields. But when the validator is accessing the masked empty field, the value attribute is 0.
I do not want to consider empty values a zero. I want to consider empty values as invalid. I have tried to put the Validators.required
validator before the custom validator, but the empty field pass.
Any way to accessing the raw field value? I need this.
Regards,
Luis
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:11 (1 by maintainers)
Top Results From Across the Web
InputMask Raw Values | Input | JavaScript Wijmo Demos
The InputMask's value property returns the full text content of the control, including the user's input and any template characters. Use the rawValue...
Read more >How to get the raw value of an antd form field using antd-mask ...
Here is an working example on codesandbox.io. Fill in any value on both fields and open console. Once you click on Confirm the...
Read more >Solved: How to mask a field value from raw events that sho...
I'm trying to mask a field value for a policy number that is present in my raw logs under different patterns. To explain...
Read more >Input Mask Guide | imaskjs
Instance of InputMask is returned when IMask constructor is called. To create new mask on element use: var mask = IMask(element, maskOptions);. Get/set...
Read more >Input Masking | CSS-Tricks
... when inputs that expect data in a specific format use an input mask. ... and the bundled plugin is 180 KB (raw),...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The same problem still affects me, there is the only one way, change the library
@Thegrep01 I think I found the problem. The ngx-mask is working fine when the initial value is empty. But when the initial value of the model is a number, emptying the text input will set the value of the model to 0 not empty.
sampleModel = null;
the value of thesampleModel
after emptying the text input will be emptysampleModel = 1; //or any number
the value of thesampleModel
after emptying the text input will be 0