' Width="60px" Enabled="false" > ' Width="60px" Enabled="false" > ' Width="60px" Enabled="false" >

Backspace or Delete key In TextBox with Masked Edit Extender in ASP.NET not working in Chrome

15.1k Views Asked by At
           <asp:TextBox ID="txttime" runat="server" CssClass="TextBox">'
                 Width="60px" Enabled="false" ></asp:TextBox>

          <ajax:MaskedEditExtender ID="ajaxtime" runat="server" AcceptNegative="None"
         Enabled="True" TargetControlID="txttime" MaskType="Time" AcceptAMPM="true"
       ask="99:99" CultureName="en-CA"  AutoComplete="true" AutoCompleteValue="99:00"/>

In Above code delete or backspace key in textbox working Firefox and IE but not working in Chrome.. Please Help..

Any Suggestion....??

4

There are 4 best solutions below

2
Jeetu On

Google chrome has such more issues with controls. You can specifically check version you are running on & what ascii values it takes? when you try to use keys. One more thing, check your textbox markup whether it is correct or not?

1
Sandeep On

below code works fine, replace TargetControlID="txtPhone" by your text field id.

<ajax:MaskedEditExtender ID="textPhone_MaskedEditExtender" MaskType="None" runat="server"
                                CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" CultureDateFormat=""
                                CultureDatePlaceholder="" CultureDecimalPlaceholder="" CultureThousandsPlaceholder=""
                                CultureTimePlaceholder="" Enabled="True" TargetControlID="txtPhone" Mask="(999)-999-9999"
                                AutoComplete="true" ClearMaskOnLostFocus="false" CultureName="en-US">
                            </ajax:MaskedEditExtender>
0
Brett Postin On

It seems this was a bug in the MaskedEditExtender. See this CodePlex issue.

You could try updating to the latest version at it states it was fixed in the April 2013 release.

Alternatively there is a small fix available here.

1
Krishna Balyapelli On

Add below code, it should work fine.Thanks.

protected void Page_Init(object sender, EventArgs e)
        {
            try
            {
                if (!ClientScript.IsStartupScriptRegistered(GetType(), "MaskedEditFix"))
                {
                    ClientScript.RegisterStartupScript(GetType(), "MaskedEditFix", String.Format("<script type='text/javascript' src='{0}'></script>", Page.ResolveUrl("../Javascript/MaskedEditFix.js")));
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }