Safari 5: Enabled button looks like it is still disabled

2 posts, 0 answers
  1. Shashank
    Shashank avatar
    1 posts
    Member since:
    Oct 2011

    Posted 05 Oct 2011 Link to this post

    Hi,

    I am facing the following problem in safari 5.

    1. I have a button which is disabled in design mode
    2. I am enabling this button via javascript.
    3. Though the button gets enabled, the button looks like it is still disabled

    The style used is Office 2007 and the version of telerik used is 2009 or 2010 [not sure].

    Regards,
    Shashank


     

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <head runat="server">
        <title></title>
      
        <script type="text/javascript">
            function EnableButton() {
      
                var btn = document.getElementById("btnTarget");
                btn.disabled = false;
            }
            
        </script>
      
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
            <telerik:RadFormDecorator Skin="Office2007" ID="RadFormDecorator1" DecoratedControls="all"
                runat="server" DecorationZoneID="zoneButtons" />
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <div id="zoneButtons">
                        <asp:Button ID="btnTarget" Text="Target" runat="server" Enabled="false" />
                        <asp:Button runat="server" ID="btnSource" Text="Click to enable 'Target'" Enabled="true"
                            OnClientClick="EnableButton();return false;" />
                    </div>
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>
        </form>
    </body>
    </html>

     

     

     

     

  2. Niko
    Admin
    Niko avatar
    387 posts

    Posted 10 Oct 2011 Link to this post

    Hello Shashank,

    Due to browser restrictions and issues some of the core DOM properties cannot be handled correctly when changing. For that you should explicitly call the enable/disable custom method. Here is a sample implementation:
    function EnableButton() { 
        var btn = document.getElementById("btnTarget"); 
        btn.disabled = false;
        Telerik.Web.UI.RadFormDecorator._globalInputDisabled.call(btn, false);
    }

    Hope this helps.

    Regards,
    Niko
    the Telerik team
    Explore the entire set of ASP.NET AJAX controls we offer here and browse the myriad online demos to learn more about the components and the features they incorporate.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top