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

Disable Telerik Button with javascript, after click.

3 Answers 979 Views
Button
This is a migrated thread and some comments may be shown as answers.
Technology
Top achievements
Rank 1
Technology asked on 05 May 2011, 09:46 AM
Dear support team,

i have this problem.
I'm trying to disable the Telerik button after the click.
When i use the ASP:Button it works. When i use Telerik button, is not working.
Can you please help me with this?
Below you will find my code.

Javascript:
        function disableBtn(btnID, newText) {

            var btn = document.getElementById(btnID);
            btn.disabled = true;
            btn.value = newText;
        }

Telerik Button:
                <asp:UpdatePanel runat="server" ID="Panel">
                    <ContentTemplate>
                        <telerik:RadButton ID="btnSave" runat="server" ButtonType="LinkButton" Text="Proccess"
                            Width="50px" BorderColor="#006699" BorderStyle="Solid" BorderWidth="1px" ForeColor="#003366"
                            Height="40px" CssClass="SmallRadButtonsTop corners-all" Font-Size="Small" ValidationGroup="SaveOrder"
                            Enabled="False" Skin="Windows7" HoveredCssClass="ShadowOver" PressedCssClass="ShadowClick"
                            OnClientClicked="disableBtn(this.id, 'Submitting...')">
                            <Icon PrimaryIconUrl="~/Images/Save2.gif" PrimaryIconHeight="30" PrimaryIconWidth="50" />
                        </telerik:RadButton>
                    </ContentTemplate>
                </asp:UpdatePanel>
                <asp:UpdateProgress ID="progress1" runat="server" AssociatedUpdatePanelID="Panel">
                    <ProgressTemplate>
                        <div class="">
                            <asp:Image runat="server" ImageUrl="images/loading.gif" />
                            <br />
                            Your Request is in Proccess.
                            <br />
                            Please Wait...
                        </div>
                    </ProgressTemplate>
                </asp:UpdateProgress>

Thank you in advance for you help.

Best Regards,
George.
Technology Department.

3 Answers, 1 is accepted

Sort by
0
Accepted
Bozhidar
Telerik team
answered on 05 May 2011, 10:34 AM
Hello,

I would snuggest to take a look at: Single Click Button Demo where similar behavior is presented and with just few modification it will be useful for your scenario also.

All the best,
Bojo
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Peter
Top achievements
Rank 1
answered on 03 Mar 2015, 03:52 AM
Using Single-Click, how do you reset the button back to normal after the post-back?
0
Peter
Top achievements
Rank 1
answered on 03 Mar 2015, 03:55 AM
To ensure the SingleClick button resets properly after the post-back, you naturally have to make sure it's wired-up in the AJAX against itself:

<telerik:AjaxSetting AjaxControlID="btnSend">
                <UpdatedControls>                    
                    <telerik:AjaxUpdatedControl ControlID="btnSend" />
                </UpdatedControls>
            </telerik:AjaxSetting>
Tags
Button
Asked by
Technology
Top achievements
Rank 1
Answers by
Bozhidar
Telerik team
Peter
Top achievements
Rank 1
Share this question
or