This is a migrated thread and some comments may be shown as answers.

Safari 5: Enabled button looks like it is still disabled

1 Answer 34 Views
FormDecorator
This is a migrated thread and some comments may be shown as answers.
Shashank
Top achievements
Rank 1
Shashank asked on 06 Oct 2011, 01:26 AM
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>

 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Niko
Telerik team
answered on 10 Oct 2011, 05:22 PM
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.
Tags
FormDecorator
Asked by
Shashank
Top achievements
Rank 1
Answers by
Niko
Telerik team
Share this question
or