jQuery UI Widgets Forums Editors MaskedInput Remove mask on (Masked)Input

This topic contains 4 replies, has 2 voices, and was last updated by  Blaat 10 years ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • Remove mask on (Masked)Input #63442

    Blaat
    Participant

    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!

    Remove mask on (Masked)Input #63446

    Peter Stoev
    Keymaster

    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 Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Remove mask on (Masked)Input #63456

    Blaat
    Participant

    Hi 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});

    Remove mask on (Masked)Input #63457

    Peter Stoev
    Keymaster

    Hi Blaat,

    Well, this is not possible. The masked input is for that – to restrict the user’s input.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Remove mask on (Masked)Input #63465

    Blaat
    Participant

    Hi!

    Ah i get it. Thanks for the quick response.

    = Removed content pointing to third-party component =

    Anyway, thanks for the support!

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.