Mask for hour with iMask

Asked

Viewed 412 times

0

I’m wearing this jquery plugin to format masks but I’m not able to make it work, even religiously following the existing example, I tried it by changing an existing format to my case:

$(document).ready(function() {
    $('#dHora').iMask({
          type      : 'fixed'
        , mask      : '00:00'
        , stripMask : true
    })  
});

But the mask is not applied.

  • 1

    Try changing to 99:99 (0 is no joker for anything)

  • 1

    Hello @Luis Henrique, had changed so much that I had not even noticed this glaring fault of mine, thanks for the help.

  • Have you seen this question -> http://answall.com/q/71094/129 ?

  • 1

    @Luizhenrique formulate an answer :) even if simple can be useful, I think

  • But why not use the Html5 team?

1 answer

2


Just change the defined wildcards for the mask:

00:00

Must be replaced by:

99:99

When you used 0 it is not replaced by anything because it is not a joker for the plugin that runs behind.

The wildcards available to be used as a mask according to documentation are:

9 = Numeric

a = Alpha

x = Alphanumeric

Browser other questions tagged

You are not signed in. Login or sign up in order to post.