Setting Upload Enabled With Javascript Problem

Thread is closed for posting
2 posts, 0 answers
  1. Paul Herzberg
    Paul Herzberg avatar
    20 posts
    Member since:
    Jun 2010

    Posted 25 Jun 2015 Link to this post

    Hello,

    My problem is this:

    I have an upload control (Cloud or Async depending on the setup) in a mulitpage tab.

    I have a checkbox that the user has to check to say that they have the right to upload the file.

    I would like to disable the Upload until the user checks the checkbox

    If I set the Upload Enabled to false in the code behind, when I set it to enabled with javascript (upload.set_enabled(true)) the Upload no longer functions (the file dialog does not open when the control is clicked).

    I have tried to set upload.set_enabled(false) when the document is ready but this doesn't work  because the Upload is on a tab it isn't rendered until that tab is open, I think, and so a $find(uploadclientid)  in javascript returns null.

    Is there a workaround for any of this?

     

    Thank you

    Paul Herzberg

     

  2. Paul Herzberg
    Paul Herzberg avatar
    20 posts
    Member since:
    Jun 2010

    Posted 25 Jun 2015 in reply to Paul Herzberg Link to this post

    Hello again,

    In writing this a solution occured to me. It seems to work:

    function setFileEnabled(enabled, clientid) {
        var upload = $find(clientid);
        if (upload != null) {
            upload.set_enabled(enabled);
            if (enabled) {
                upload.deleteFileInputAt(0);
            }
        }
    }

     

    Thank you

     

    Paul

  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top