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

disable button on client file select

1 Answer 27 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Craig Wallace
Top achievements
Rank 1
Craig Wallace asked on 10 Oct 2013, 10:22 AM
I want to disable another button on my page when the user chooses a file for upload.  It looks like this has to be client side, which is fine, but when I wire up the OnClientAdding function it gets called when the page loads, and the ClientID of the RadUpload control evaluates to null.

How can I achieve what I want?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 11 Oct 2013, 07:44 AM
Hi Craig,

You can hook to the OnClientFileSelected client side event to disable any control on the page when a file is selected for uploading. Please check the following sample code I tried which works fine at my end. Also note that the OnClientAdding event fires (even at the time of loading the page) when a row is about to be added to the RadUpload control.

ASPX:
<telerik:RadUpload ID="RadUpload1" runat="server" OnClientFileSelected="OnClientFileSelected">
</telerik:RadUpload>
<br />
<telerik:RadButton ID="RadButton1" runat="server" Text="Click">
</telerik:RadButton>

JavaScript:
<script type="text/javascript">
    function OnClientFileSelected(sender, args) {
        var radbutton = $find('<%=RadButton1.ClientID %>');
        radbutton.set_enabled(false);
    }
</script>

Thanks,
Shinu.
Tags
Upload (Obsolete)
Asked by
Craig Wallace
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Share this question
or