3

Closed

MaskedEditExtender erases all values beyond first comma separtor

description

When using the MaskedEditExtender with a Mask such as "999,999.99" and ClearMaskOnLostFocus="false" all values after the comma separator are erased when prepopulating (databinding) the TextBox control. See example below:

<asp:TextBox ID="Price" runat="server">9,999.00</asp:TextBox>
<cc1:MaskedEditExtender ID="PriceMask" runat="server" AutoComplete="false" ClearMaskOnLostFocus="false" DisplayMoney="Left" InputDirection="RightToLeft" Mask="9,999,999.99" MaskType="Number" TargetControlID="Price">
</cc1:MaskedEditExtender>

When viewed in the browser you will see "$_,___,999.00" as the value in the TextBox. I've tried removing/changing several properties to include AutoComplete and InputDirection which have no affect on this problem. The only solution (workaround) is to set ClearMaskOnLostFocus="true" (default).
Closed May 3, 2013 at 7:05 AM by Superexpert
Issues is closed as we are not able to reproduce. Please reopen with sample code if someone still getting problem.

comments

thecodedude wrote Jul 22, 2007 at 9:26 PM

UPDATE: I was able to reproduce this behavior in the Sample WebSite using the current Build 10618 by modifying the MaskedEdit Sample as follows:
    Enter a Number (format: 9,999,999.99):                                    TargetControlID="TextBox2"            ClearMaskOnLostFocus="false"            Mask="9,999,999"            MessageValidatorTip="true"            OnFocusCssClass="MaskedEditFocus"            OnInvalidCssClass="MaskedEditError"            MaskType="Number"            InputDirection="RightToLeft"            AcceptNegative="Left"            DisplayMoney="Left"            ErrorTooltipEnabled="True" />                    ControlExtender="MaskedEditExtender2"            ControlToValidate="TextBox2"            IsValidEmpty="False"            MaximumValue="12000"            EmptyValueMessage="Number is required"            InvalidValueMessage="Number is invalid"            MaximumValueMessage="Number > 12000"            MinimumValueMessage="Number < -100"            MinimumValue="-100"            Display="Dynamic"            TooltipMessage="Input a number from -100 to 12000"            EmptyValueBlurredText="*"            InvalidValueBlurredMessage="*"            MaximumValueBlurredMessage="*"            MinimumValueBlurredText="*"            ValidationGroup="MKE" />        
This causes "$ ,__,__9" to display in TextBox2 with a default Text value of "9999". When I remove the ClearMaskOnLostFocus property the correctly formatted value displays in the field.