SoFunction
Updated on 2025-04-13

Javascript & DHTML Upload File Control Page 2/4


<script> 
 = function () { 
  /* 
* Generate a file
   */ 
  var self = this; var cnt = this._cnt; 
  var cFile = ("input"); 
  ="file"; ="upload"; 
   = "upload_file_" +cnt; 
  /* 
* Generate one Add
   */ 
  var cAdd = ("span"); 
="Add";
   = function () { 
    (); 
  }; 
  /* 
* Generate a delete
   */ 
  var cRemove = ("span"); 
="Delete";
   = function () { 
    (cnt); 
  }; 

   = "upload_add_" +cnt; 
   = "upload_remove_" +cnt; 

/* Add all generated information to the container */
  (cFile); 
  (cAdd); 
  (cRemove); 

/* Counter +1 */
  this._cnt++; 

return this; //Return
}; 
</script>