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

Want to show button on ClientTransferred event. Not working in ie!

1 Answer 73 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
fred williams
Top achievements
Rank 1
fred williams asked on 25 Mar 2011, 07:05 PM
So I've written some javascript code that should display a button when the listbox's OnClientTransferred event fires. It works fine in Chrome and Firefox but not IE (big surprise). I am using an asp:update panel so I'll post THE JavaScript and all of the relevant markup in case that matters.

function showButton(){
     var btn = document.getElementById('<%=btnClientCont.ClientID%>');
     btn.style.display = "inherit";
}

and the markup

<div>
<asp:UpdatePanel ID="updatepanel" runat="server"><ContentTemplate>
<table><tr><td>
<telerik:RadListBox runat="server" ID="lstBox" OnClientTransferred="showButton">
</telerik:RadListBox>
</td></tr>
<tr><td><telerik:RadListBox></telerik:RadListBox></td>
<tr><td><asp:Button ID="btnReset" OnClick="rebindAll"/></td></tr>
</ContentTemplate><Triggers><asp:AsyncPostBackTrigger ControlID="btnReset" EventName="Click"/>
<asp:PostBackTrigger ControlID="btnClientCont"/></Triggers></asp:UpdatePanel></div>
<div><input type="submit" runat="server" onservercick="btnContinue_Click" id="btnClientCont"/></div>

Again, this works in both Chrome and Firefox, but the button won't appear in IE (tested on both 8 and 9).

1 Answer, 1 is accepted

Sort by
0
Dimitar Terziev
Telerik team
answered on 31 Mar 2011, 02:13 PM
Hi Fred ,

We noticed in the provided code that this submit button is visible. In order to make it invisible you should add the following style in it's declaration:

style="visibility:hidden"
 
Once the submit button is invisible upon the page load, you should modify your showButton javascript function in the following way:

function showButton() {
    var btn = document.getElementById('<%=btnClientCont.ClientID%>');
    btn.style.display = "block";
    btn.style.visibility = "visible";
     
}

This approach has been tested both in IE8 and IE7.

All the best,
Dimitar Terziev
the Telerik team
Tags
ListBox
Asked by
fred williams
Top achievements
Rank 1
Answers by
Dimitar Terziev
Telerik team
Share this question
or