jQuery UI Widgets Forums Editors MaskedInput Issue with jqxMaskedInput

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 8 years, 10 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Issue with jqxMaskedInput #5345

    binfch
    Participant

    Hi there

    I am having an issue with jqxMaskedInput. The challenge is to restrict the input to digits 0-9 and capital characters A-Z (Except characters ‘L’ and ‘O’). The length of the input has to be 17 long.

    My code so far looks like this:

    $("#QInput").jqxMaskedInput({
    theme: 'classic',
    width: '160px',
    height: '25px',
    textAlign: 'left',
    mask: '#################',
    promptChar: ''
    });

    var regexDigit = '(\\b[0-9A-Z])';
    for (i = 0; i < 16; i++) {
    $("#QInput").jqxMaskedInput('setRegex', i, regexDigit);
    }

    There is some strange behaviour when trying to delete some characters using the backspace or the delete keys (characters are not deleted but overwritten somehow). Also strangely the last input character (17th) can only be numberic!?

    P.S: I am using release 2.2.1

    Thanks & cheers,
    Peter

    Issue with jqxMaskedInput #5346

    Peter Stoev
    Keymaster

    Hi Peter,

    The regex should be:

               // set regular expressions.
    var regex = '(\\b[A-KM-NP-Z0-9])';
    for (i = 0; i < 17; i++) {
    $("#regexInput").jqxMaskedInput('setRegex', i, regex);
    }

    For 17 characters, your loop should be to 17, not to 16.

    The promptChar shouldn’t be an empty chart. It must have a value like: ‘_’, ‘?’, ‘#’ or something like that.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.