Get unmasked value in oncomplete
See original GitHub issueHi! Use this great plugin, but have small problem I need to send value from field for statistic purposes with this code (value could be 10 or 12 numbers):
$('#Inn').inputmask({
mask: "9999999999[99]",
autoUnmask: true,
removeMaskOnSubmit: true,
oncomplete: function (e)
{
var inn = e.target.value;
$.getJSON('/sendData?inn=' + encodeURIComponent(inn));
}
});
XHR finished loading: GET "http://localhost/sendData?inn=2311113226__".
Only when I get another call for unmasked values all goes ok:
$('#Inn').inputmask({
mask: "9999999999[99]",
autoUnmask: true,
removeMaskOnSubmit: true,
oncomplete: function ()
{
var inn = $('#Inn').inputmask('unmaskedvalue');
$.getJSON('/sendData?inn=' + encodeURIComponent(inn));
}
});
XHR finished loading: GET "http://localhost/sendData?inn=2311113226".
Is it right way to get unmasked value in “oncomplete” hanlder?
P.S.: Using jQuery 1.11.2 and jquery.inputmask 3.1.62
Issue Analytics
- State:
- Created 8 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
jquery.inputmask - set value in "oncomplete" callback makes ...
It seems as though you have uncovered a critical bug with the jQuery inputmask plugin. There is some aggressive caret position handling when...
Read more >Input Mask Guide | imaskjs
Get /set value and unmasked value: masked.value = 'hello world!'; console.log(masked.unmaskedValue); // or typed value if it makes sense console.log(masked.
Read more >A jQuery Plugin to make masks on form fields and html ...
jQuery-Mask-Plugin - A jQuery plugin to make field masks. ... $(selector).unmask(); /** Gets the value of the field without the mask.
Read more >jquery.inputmask - UNPKG
7, Inputmask is a javascript library which creates an input mask. ... 27, - value formatting / validating without input element ... 669,...
Read more >commitMutation | Relay
The value passed to onCompleted is the the mutation fragment, ... This means that data from within unmasked fragments will not be read, ......
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 FreeTop 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
Top GitHub Comments
Ok! I think
var inn = this.value;
will work the same way for simple text input@Alex-Sokolov ,
You can also just do