Disabling/Enabling Server side button following file attachment

Last post 09-28-2010, 8:18 AM by ssoutrs. 4 replies.
Sort Posts: Previous Next
  •  09-23-2010, 4:14 PM 64175

    Disabling/Enabling Server side button following file attachment

    Hey guys I was hoping someone in this community could help me out with a problem I am having.  For the Ajax Uploader control I have it set up so that after you upload files the upload button gets disabled.  If you then go and click on the button to open up the filebrowser so that you can upload more files I want to re-enable the upload button after it shows the list of files you just attached.  I have tried all the server side events and a good chunk of client side events but I have not got it to work correctly yet.  Any help with this problem would be much appreciated :). Thank you!
  •  09-23-2010, 9:13 PM 64179 in reply to 64175

    Re: Disabling/Enabling Server side button following file attachment

    Hi ssoutrs,
     
    Please try the example below
     
    1. <%@ Page Language="C#" %>   
    2.   
    3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">   
    4. <html xmlns="http://www.w3.org/1999/xhtml">   
    5. <head runat="server">   
    6.     <title>Untitled Page</title>   
    7. </head>   
    8. <body>   
    9.     <form id="form1" runat="server">   
    10.         <CuteWebUI:UploadAttachments ID="attachment1" runat="server">   
    11.         </CuteWebUI:UploadAttachments>   
    12.     </form>   
    13. </body>   
    14. </html>   
    15.   
    16. <script>   
    17. function CuteWebUI_AjaxUploader_OnStart()   
    18.   
    19. {   
    20.     var hidden=this;   
    21.   
    22.     hidden.internalobject.insertBtn.disabled=true;   
    23.   
    24. }   
    25. </script>  
    Regards,
     
    ken
  •  09-24-2010, 8:08 AM 64184 in reply to 64179

    Re: Disabling/Enabling Server side button following file attachment

    No, that did not work :(.  I don't think I explained my problem very well so I will try again.  I included a picture at the bottom for illustration purposes.  See how the upload button is currently disabled?  That button became disabled when I uploaded the penguins.jpg files.  When I click on Add Files to select more files to upload I want to re-enable the upload button once those files are attached.  In this case the Upload button should have become re-enabled once I attached Chrysanthemum.jpg since that file is still waiting to be uploaded.  Any help with this would be appreciated.  Thank you!

     


  •  09-27-2010, 3:22 AM 64202 in reply to 64184

    Re: Disabling/Enabling Server side button following file attachment

    Hi ssoutrs,
     
    Try this example
     
    1. <%@ Page Language="C#" %>   
    2.   
    3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">   
    4.   
    5.   
    6. <html xmlns="http://www.w3.org/1999/xhtml">   
    7. <head runat="server">   
    8.     <title>Untitled Page</title>   
    9. </head>   
    10. <body>   
    11.     <form id="form1" runat="server">   
    12.         <div>   
    13.             <CuteWebUI:UploadAttachments runat="server" ManualStartUpload="true" ID="Uploader1"  
    14.                 InsertText="Browse Files">   
    15.             </CuteWebUI:UploadAttachments><br />   
    16.             <input type="button" value="Upload" onclick="submitUpload()" disabled="disabled" id="startUpload" />   
    17.         </div>   
    18.     </form>   
    19. </body>   
    20. </html>   
    21.   
    22. <script>   
    23. function submitUpload()   
    24. {   
    25.     var uploader1=document.getElementById("<%= Uploader1.ClientID %>");   
    26.     uploader1.startupload();   
    27. }   
    28. function CuteWebUI_AjaxUploader_OnSelect(files)   
    29.   
    30. {   
    31.   
    32. var startUpload=document.getElementById("startUpload");   
    33. startUpload.disabled="";   
    34.   
    35. }   
    36.   
    37. </script>  
    Regards,
     
    ken
  •  09-28-2010, 8:18 AM 64221 in reply to 64202

    Re: Disabling/Enabling Server side button following file attachment

    Hello again.  Sorry about the late reply.  The OnSelect did not work for me.  However, the OnQueueUI did.  I do have another issue I was hoping you could help me with if possible.

    Currently I have the Add Files (Browse) button at the top.  The files I choose to attach show right below that as a table.  But my boss would like me to move that button down to the bottom next to the upload button.  However, when I do that the attachments table shows right below that, off the edge of the popup window.  I would like to keep the attachments table in the same spot and just move the button.  Is there a way to do that?

     

     

View as RSS news feed in XML