Giorgi
Giorgi

Reputation: 609

Javascript .mask() masked input multiple optionals

Im using javascript plugin masked input.

my current code is:

 $("#a").mask("9?9999", {"placeholder": ""}); //so other 4 9999 are optional

what i want to achieve is something like this:

 $('#a').mask("9?9999?.99?9", {"placeholder": ""});

i want a user to be able to type the following:

    5 //valid
    7.99 //valid
    7712.239 //valid

is there a way of achieving this with .mask() ? i tried the above code but didnt seem to work.

Upvotes: 0

Views: 6259

Answers (1)

user757095
user757095

Reputation:

the simple answer is no.

maybe you could look at the jquery.numeric plugin, which is specific for numeric input box.

Upvotes: 1

Related Questions