views:

418

answers:

1

Hi everyone,

I have been putting only jQuery mask so far, but I figured out that in Mozilla they have some problem. For example if I mask input with $(".someClass").mask("9?9"); and enter only one digit '1' Mozilla will submit value of "1_" which fails validation (is a number) but user definitely entered correct value.

Is there a mask like $(".someClass").mask("9?9"); that won't display underscore for maximum number of characters (in this case 2) so that user does not think that he must enter 2 characters???

Other problem is when you lose focus on masked field but you entered just few first required characters. When you return focus on the field it continues from the las character but erases all already entered.

I have tried also Telerik but it has so menu bugs and much more problems with underscore and cursor position.

Please if wrote if you have any suggestions and solutions.

Thanks a lot.

+1  A: 

Can't reproduce your problem. Check demopage. If you enter only one number the value of the input is just that number. (What jquery version? What browser version?). Provide small sample which reproduces your problem.

http://jsbin.com/egeyo3

Your mask looks ok to me. If you don't want the user to think he needs to enter 2 numbers just replace the default placeholder _ with a space .

jQuery(function($) {
    $("#test").mask("9?9", {placeholder:" "});
});
jitter
I am using the newest jQuery and mozilla. i just realized that it passes client (is number) validation but fails on server (in code behind ASP.NET)
SonOfOmer
Can't understand your comment. Are you saying ASP.NET is responsible for your problem
jitter
Never mind I have just solve problem with you help, to reproduce problem do not use placeholder and leave underscores then it will save 1_ in Mozilla. Thanks.
SonOfOmer