Hi All,
 I am using the following code to upload file and add the file tag
dynamically for my application. Jquery doen't seem to be working for the
dynamically added file.
Any help is appreciated.

<html>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.MultiFile.js"></script>
<script type="text/javascript" src="js/jquery.MultiFile.pack.js"></script>
<script language="javascript">
var intVal = 1;
function addUploadFile() {
  var innerinVal = ++intVal;
  var divTagVal = divTagTemplate.cloneNode(true);
  document.getElementById('outerVal').appendChild(divTagVal);
 }
</script>
<form action="doUpload" enctype="multipart/form-data" method="post">
<div id="outerVal">
<p>
Type some text (if you like):<br>
<input type="text" name="textline" size="30">
</p>
<p id="addVal1">
Please specify a file, or a set of files:<br>
<input type="file" class="multi" id="test1" name="datafile" size="40">
</p>
<div>
<input type="submit" value="Send">
<input type="button" class="button" value="Add File"
onclick="javascript:addUploadFile();" id="addFileButton" />
</div>
</div>
</form>
<script> var divTagTemplate =
document.getElementById('addVal1').cloneNode(true);
</script>
</html>

Reply via email to