How can i disable or enable File upload control of .NET framework using Javascript??
Does any one have idea, please help.
Thanks in advance.
Try doing this:
<script type = "text/javascript">
function EnableDisable(rbl) {
var rb = rbl.getElementsByTagName("input");
document.getElementById("<%=FileUpload1.ClientID %>").disabled = true;
for (var i = 0; i < rb.length; i++) {
if (rb[i].value == 1 && rb[i].checked) {
document.getElementById("<%=FileUpload1.ClientID %>").disabled = false;
}
}
}
</script>
<form runat = "server">
<asp:RadioButtonList ID="RadioButtonList1" runat="server" onclick = "EnableDisable(this)">
<asp:ListItem Text = "Yes" Value = "1"></asp:ListItem>
<asp:ListItem Text = "No" Value = "2"></asp:ListItem>
</asp:RadioButtonList>
<asp:FileUpload ID="FileUpload1" runat="server" disabled = "disabled"/>
</form>