Problems with MaskEdit Extender & Validator

Last post 11-30-2007 3:23 PM by Careed. 3 replies.

Sort Posts:

  • Problems with MaskEdit Extender & Validator

    11-30-2007, 1:19 PM
    • Member
      183 point Member
    • HoLLoW
    • Member since 05-15-2005, 1:27 AM
    • Un Mexicano En Brasil
    • Posts 86

    I have some problems with Maskedit extender & validator...

     I have this code, can anyone tell me why when i put a valid data (just numbers) when i go to another textbox it tells me that the ( * Numer is invalid )

    <asp:TextBox ID="txtCPF" runat="server" />
     <ajaxToolKit:MaskedEditExtender ID="meeCPF" AutoComplete="False" ClearMaskOnLostFocus="False"
                InputDirection="LeftToRight" Mask="9{3}.9{3}.9{3}\-9{2}" MaskType="Number" CultureName="en-US"
                MessageValidatorTip="true" UserDateFormat="DayMonthYear" TargetControlID="txtCPF" runat="server" />
                <ajaxToolKit:MaskedEditValidator ID="mevCPF" Display="Dynamic"
                ControlExtender="meeCPF" ControlToValidate="txtCPF" ValidationGroup="vgPF"
                IsValidEmpty="False" SetFocusOnError="True" InvalidValueMessage="Number is invalid"
                runat="server" />

    life is lost in dreaming, dreaming is lost in becoming
    -----------------------------------------------------------
    Please remember to click “Mark as Answer” on the post that helps you. This can be beneficial to other community members reading the thread.
  • Re: Problems with MaskEdit Extender & Validator

    11-30-2007, 2:08 PM
    • Star
      8,182 point Star
    • Careed
    • Member since 06-24-2002, 7:37 AM
    • Lubbock, TX
    • Posts 1,597

    Because it's not a number.  Your mask produces a value like 938.293.290\-32 (I think).  With the multiple "decimal points", it cannot be intrepreted as a number.

    Consider setting MaskType="None".  Also, I'm not sure the UserDateFormat is need if it's not a date.

    Christopher Reed
    "The oxen are slow, but the earth is patient."
  • Re: Problems with MaskEdit Extender & Validator

    11-30-2007, 2:28 PM
    • Member
      183 point Member
    • HoLLoW
    • Member since 05-15-2005, 1:27 AM
    • Un Mexicano En Brasil
    • Posts 86

    yap, the UserDateFormat i was just testing, forgott to take it off.... but i the \- it's suppost to show ---->>> 938.293.29032 and it actually doesn't do that...

     also this (9{3}\.9{3}\.9{3}\-9{2} ) should work, but it' doesn't... any ideas?

    life is lost in dreaming, dreaming is lost in becoming
    -----------------------------------------------------------
    Please remember to click “Mark as Answer” on the post that helps you. This can be beneficial to other community members reading the thread.
  • Re: Problems with MaskEdit Extender & Validator

    11-30-2007, 3:23 PM
    Answer
    • Star
      8,182 point Star
    • Careed
    • Member since 06-24-2002, 7:37 AM
    • Lubbock, TX
    • Posts 1,597

    If it's because the MaskType is Number, then it's because a "number" only has one decimal point.  Thus, this format does not confirm to anything numeric, so it should be set to None.

    Christopher Reed
    "The oxen are slow, but the earth is patient."
Page 1 of 1 (4 items)