Menu

Zero as first digit in NumberMasks

2008-07-16
2013-04-22
  • Leonel Fonseca Ivo

    Hello guys,

    I'm having some trouble with the NumberMasks I'm using in a web portal. In the application it's being used, a zero as the leftmost digit of a number (integer) should be valid, since the number masks represents document numbers. The masks doesn't accept the '0' as the first digit. How can I fix it ?

    Thanks in advance,

    Leonel

     
    • Leonel Fonseca Ivo

      Oops ! I forgot to mention that I'm using the JavaScripTools version 2.2.1, released in January 10th of the present year.

      Thanks again

       
      • Luis Fernando Planella Gonzalez

        Hi!
        The NumberMask is supposed to create numbers, and zeros on the left side are void.
        If you want something like a "string containing numbers only", then you should not use a NumberMask, but an InputMask, like this:
        new InputMask(JST_MASK_NUMBERS, "field");

         
    • Leonel Fonseca Ivo

      That's what I did. =)

      But now I've another doubt. Is there a way to choose the typing from right to left when using InputMask ? It's to use in the same inputs where I made the changes.

      Thanks for the tip and the attention.

       
      • Luis Fernando Planella Gonzalez

        No, InputMask only support typing from left to right.
        What might give you the impression you want is to use a text-align:right CSS rule to the input field.

         
    • Leonel Fonseca Ivo

      Ok.

      Thanks very much

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.