jQuery UI Widgets Forums Editors MaskedInput restrict mask input

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

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • restrict mask input #1269


    Is it possible to restrict the input of the first character in the string to 0 or 1 ?

    restrict mask input #1272

    Peter Stoev

    Hi sushant,

    You can achieve this by using the ‘setRegex’ function of the jqxMaskedInput. In the code example below, I call the setRegex function passing the mask character index and regex expression as parameters.

    // set regex for the first character
    var regex = '(\\b[0-1])';
    $("#numericInput").jqxMaskedInput('setRegex', 0, regex);

    Best Regards,
    Peter Stoev

    jQWidgets Team

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

You must be logged in to reply to this topic.