Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
2.5k views
by (160 points)
Hi,

If I put more than one upload button on the same web page, sometimes got Javascript error !!

function completeProgressBar(ftpClient, taskID, success, text, errorMessage) {
   var progressID = "Transfer" + taskID;
   var progressTable = document.getElementById("EdtUploadProgressTable"+ftpClient.id);
   if (progressTable===null)
      return;
      
   var barTable = document.getElementById(progressID+"-bar");
   var progressRow = document.getElementById(progressID + "-row");
   var textCell = document.getElementById(progressID + "-text");
   var progressBar = document.getElementById(progressID + "-left");
   var cancelImage = document.getElementById(progressID + "-cancelImage");
   var cancelLink = document.getElementById(progressID + "-cancelLink");

   // complete progress bar   
   barTable.rows[0].deleteCell(1);

   Uncaught Error: INDEX_SIZE_ERR: DOM Exception 1 
...... 

}

2 Answers

0 votes
by (160 points)
The multiple Upload button web page:
<!doctype html>
<html>
  <head>
    <title>IntegralFTP - Upload control example</title>
    <style>
      dt { font-weight: bold; margin-top: 15px; }
    </style>
    <link rel="StyleSheet" href="UploadControl.css" type="text/css" />
    <script type="text/javascript" src="UploadControl.js"></script>
    <script type="text/javascript">
        window.onload = function() {
         // -- upload _1 -----------------------------------------------------
            var uploadControl_1 = new EdtUploadControl("MyUploadControl_1");
            uploadControl_1.render();
            uploadControl_1.onClick = function() {
             this.setRemoteHost(document.getElementById("Server").value);
             this.setUserName(document.getElementById("UserName").value);
             this.setPassword(document.getElementById("Password").value);
             this.setInitialRemoteDirectory(document.getElementById("Directory").value);
             this.setLogLevel("DEBUG");
            }
            uploadControl_1.onFilesUploaded = function() { alert("Complete_1"); }
         // -- upload _2 -----------------------------------------------------
            var uploadControl_2 = new EdtUploadControl("MyUploadControl_2");
            uploadControl_2.render();
            uploadControl_2.onClick = function() {
             this.setRemoteHost(document.getElementById("Server").value);
             this.setUserName(document.getElementById("UserName").value);
             this.setPassword(document.getElementById("Password").value);
             this.setInitialRemoteDirectory(document.getElementById("Directory").value);
             this.setLogLevel("DEBUG");
            }
            uploadControl_2.onFilesUploaded = function() { alert("Complete_2"); }
         // -- upload _3 -----------------------------------------------------
            var uploadControl_3 = new EdtUploadControl("MyUploadControl_3");
            uploadControl_3.render();
            uploadControl_3.onClick = function() {
             this.setRemoteHost(document.getElementById("Server").value);
             this.setUserName(document.getElementById("UserName").value);
             this.setPassword(document.getElementById("Password").value);
             this.setInitialRemoteDirectory(document.getElementById("Directory").value);
             this.setLogLevel("DEBUG");
            }
            uploadControl_3.onFilesUploaded = function() { alert("Complete_3"); }
         // -- upload _4 -----------------------------------------------------
            var uploadControl_4 = new EdtUploadControl("MyUploadControl_4");
            uploadControl_4.render();
            uploadControl_4.onClick = function() {
             this.setRemoteHost(document.getElementById("Server").value);
             this.setUserName(document.getElementById("UserName").value);
             this.setPassword(document.getElementById("Password").value);
             this.setInitialRemoteDirectory(document.getElementById("Directory").value);
             this.setLogLevel("DEBUG");
            }
            uploadControl_4.onFilesUploaded = function() { alert("Complete_4"); }
         // -- upload _5 -----------------------------------------------------
            var uploadControl_5 = new EdtUploadControl("MyUploadControl_5");
            uploadControl_5.render();
            uploadControl_5.onClick = function() {
             this.setRemoteHost(document.getElementById("Server").value);
             this.setUserName(document.getElementById("UserName").value);
             this.setPassword(document.getElementById("Password").value);
             this.setInitialRemoteDirectory(document.getElementById("Directory").value);
             this.setLogLevel("DEBUG");
            }
            uploadControl_5.onFilesUploaded = function() { alert("Complete_5"); }
         // -- upload _6 -----------------------------------------------------
            var uploadControl_6 = new EdtUploadControl("MyUploadControl_6");
            uploadControl_6.render();
            uploadControl_6.onClick = function() {
             this.setRemoteHost(document.getElementById("Server").value);
             this.setUserName(document.getElementById("UserName").value);
             this.setPassword(document.getElementById("Password").value);
             this.setInitialRemoteDirectory(document.getElementById("Directory").value);
             this.setLogLevel("DEBUG");
  &nbsp
0 votes
by (51.6k points)
For other readers of this thread. The user e-mail the code to support. We responded by asking if he really needed to use more than one button since a single button can be pressed many times to add more than one file.

- Hans (EnterpriseDT)

Categories

...