Re: How to Hide Cancel all Uploads Button

  •  06-21-2011, 11:54 AM

    Re: How to Hide Cancel all Uploads Button

    Hi adyboy369,
     
    Please try the following code:
     

    how to hide some buttons when uploading:


    <?php require_once "phpuploader/include_phpuploader.php" ?>
    <?php session_start(); ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Form - Start uploading manually</title>
    <link href="demo.css" rel="stylesheet" type="text/css" />
    <style>
    .AjaxUploaderCancelAllButton {
     display: none !important;
    }
    </style>
    <script type="text/javascript">
     function doStart()
     {
      var hidden=this;
      document.getElementById("temptest").style.display="none";     
      var uploadobj = document.getElementById('myuploader');
      if (uploadobj.getqueuecount() > 0)
      {
       uploadobj.startupload();
      }
      else
      {
       alert("Please browse files for upload");
      }
     }
     </script>
    </head>
    <body>
    <div class="demo">
    <h2>Start uploading manually</h2>
    <p>This sample demonstrates how to start uploading manually after file
    selection vs automatically.</p>
    <P>Allowed file types: <span style="color: red">jpg, gif, txt, png, zip</span></p>
    <!-- do not need enctype="multipart/form-data" -->
    <form id="form1" method="POST">
    <?php
    $uploader=new PhpUploader();
    $uploader->MaxSizeKB=1023340;
    $uploader->Name="myuploader";
    $uploader->InsertText="Select multiple files (Max 10M)";
    $uploader->AllowedFileExtensions="*.jpg,*.png,*.gif,*.txt,*.zip,*.rar";
    $uploader->MultipleFilesUpload=true;
    $uploader->ManualStartUpload=true;
    //you can change the image color to blue or something else
    $uploader->ProgressPicture="phpuploader/resources/button.png";
    $uploader->Render();
    ?>
    <div id="temptest">
    <button id="cancelallbtn" style='display: none; color: red;'
     onclick="CancelAll();return false;">Cancel All</button>
    </div>
    <button id="submitbutton" onclick="doStart();return false;">Start
    Uploading Files</button>
    </form>
    <br />
    <?php
    $fileguidlist=@$_POST["myuploader"];
    if($fileguidlist)
    {
     $guidlist=explode("/",$fileguidlist);
     echo("<div style='font-family:Fixedsys;'>");
     echo("Uploaded ");
     echo(count($guidlist));
     echo(" files:");
     echo("</div>");
     echo("<hr/>");
     foreach($guidlist as $fileguid)
     {
      $mvcfile=$uploader->GetUploadedFile($fileguid);
      if($mvcfile)
      {
       echo("<div style='font-family:Fixedsys;border-bottom:dashed 1px gray;padding:6px;'>");
       echo("FileName: ");
       echo($mvcfile->FileName);
       echo("<br/>FileSize: ");
       echo($mvcfile->FileSize." b");
       echo("</div>");
      }
     }
    }
    ?></div>
    <script type="text/javascript">
        function CuteWebUI_AjaxUploader_OnQueueUI(list)  
        {  
            var cancelallbtn=document.getElementById("cancelallbtn");
            if(list.length<2)
            {  
              cancelallbtn.style.display="none";  
                return;  
            }  
             cancelallbtn.style.display=""; 
        }
    function CuteWebUI_AjaxUploader_OnTaskComplete(task)
     {
      var div=document.createElement("DIV");
      div.innerHTML=task.FileName + " is uploaded!";
      document.body.appendChild(div);
     }
        function CancelAll()
     {
         var uploader=document.getElementById('myuploader');
         uploader.cancelall();  
     }
        function CuteWebUI_AjaxUploader_OnStart()
        {
          var hidden=this;
           hidden.internalobject.insertBtn.style.display="none";
           hidden.internalobject.cancelBtn.style.visibility="hidden";
            hidden.internalobject.cancelBtn.style.display="none";
        }
       </script>
    </body>
    </html>
    Thanks for asking
View Complete Thread