jQuery UI Widgets › Forums › Editors › MaskedInput › Remove mask on (Masked)Input
Tagged: jqxmaskedinput, mask, masked input, remove, unmask
This topic contains 4 replies, has 2 voices, and was last updated by Blaat 8 years, 6 months ago.
-
Author
-
Dear JqxWidget Heroes,
I would like to remove the mask of an input on some conditions.
By default, the Dutch zipcode mask is added on the input. But on an event(other country selected), i would like to remove/clear/destroy/unmask the mask on the input.if (countryId == 139) { $(that.CustomerFormSelector + ' [id="ZipCode"]').jqxMaskedInput({ mask: '#### [A-Z][A-Z]' }); } else { $(that.CustomerFormSelector + ' [id="ZipCode"]').jqxMaskedInput({ mask: null }); // Remove/unmask jqxMask somehow?? }
The
.jqxMaskedInput('destroy');
destroys the whole input, but i just want to clear the mask, not the input itself.
Maybe the solution is very simple, but i don’t see it…Any ideas?Thanks in advance!
Hi Blaat,
If you want to clear the values, you may try the clearValue method. Example: http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxmaskedinput/defaultfunctionality.htm?arctic
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHi Peter,
Thanks for the quick reply!
Its not about the value, but the mask markup.
I would like to remove the mask itself. The user should be allowed to fill all kind of characters.Or is it possible to remove the maskedInput at all? Remove the .jqxMaskedInput on the input, or change it with a normal input.
Something like
$(that.CustomerFormSelector + ‘ [id=”ZipCode”]’).jqxMaskedInput(‘Remove’);
$(that.CustomerFormSelector + ‘ [id=”ZipCode”]’).jqxMaskedInput(‘Unmask’);
$(that.CustomerFormSelector + ‘ [id=”ZipCode”]’).jqxMaskedInput({ mask: unmask});
$(that.CustomerFormSelector + ‘ [id=”ZipCode”]’).jqxMaskedInput({ mask: none});Hi Blaat,
Well, this is not possible. The masked input is for that – to restrict the user’s input.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.