jQWidgets Forums

jQuery UI Widgets Forums Editors MaskedInput Masked Input Optional Characters?

This topic contains 4 replies, has 2 voices, and was last updated by  dkittell 12 years, 3 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • Masked Input Optional Characters? #15160

    dkittell
    Member

    I tried to search the site and documentation for this but I am not finding what I believe will work.

    jQuery Masks I’ve used in the past would be something like below to create the optional characters, I tried this with this package and it doesn’t appear to work. What am I missing?
    $(“#Sample”).mask(“99?.99”);

    Masked Input Optional Characters? #15161

    Peter Stoev
    Keymaster

    Hi dkittell,

    I suppose that you are looking for the “promptChar” property. See: jquery-masked-input-api.htm.

    With jqxMaskedInput, you can also customize the input for each character using Regex. See how the IP Address maskedInput is defined in this sample: defaultfunctionality.htm.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Masked Input Optional Characters? #15163

    dkittell
    Member

    Will that work in the example that there isn’t always more text to input?
    Say you have 12.40 once and then you 12.4 then 12 I’d like it to only force the . or extra numbers if needed.

    Masked Input Optional Characters? #15166

    Peter Stoev
    Keymaster

    Hi dkittell,

    With jqxMaskedInput, you need to know the number of characters that the user is allowed to enter and to set a mask with the same number of characters.

    If you want to define a mask which always has 12. and two optional characters, you should define the “mask” property in the following way:

    $("#numericInput").jqxMaskedInput({ width: '250px', height: '25px', mask: '12.##'});

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Masked Input Optional Characters? #15169

    dkittell
    Member

    Sorry I feel like a amateur now, turns out the computer I was working on had IE8 Compatibility View enabled so all the javascript code was having issues once I switched that to IE8 it worked fine.

    Sometimes working on a business computer can be a drag.

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

You must be logged in to reply to this topic.