Skip to content

Enable/Disable fileupload control with Javascript

Yashwanth Sannithi

Asked May 12, 2012, 3:03 AM EDT1 answer
Share
LinkedInX
Hi,
I have file upload and  Custom Radio button(with Images)  in the page
Requirement:
When the page load, both the file upload control and Custom Radio Buttons has to be enable. when I click on the Custom Radio buttons ,the File Upload will be disabled, when I click on the File Upload ,the Custom Radio buttons will be disabled.
Can any tell me how to do this with JavaScript?
Once check the screenshot 

It's very Urgent to get the file

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    Please try this sample....Hope you will get some idea for enable and disable the control.

    HTML / XML
    <script language="javascript" type="text/javascript">     function ToggleState() {                  document.getElementById('FileUpload1').disabled = !document.getElementById("FileUpload1").disabled;         return false;     } </script>

    Python
       <asp:FileUpload ID="FileUpload1" runat="server" />
    <input type="button" id="button2" value="Toggle State" onclick ="javascript:ToggleState();" />
    0