Hi All,
  I am having the problem with dynamic loading of <div> tag. Coping the div
tag rightly but not able to call the jquery.MultiFile.js dynamically. any
help ..??

<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/jay_dynamic_file_upload.js"></script-->


<script>

var divTagTemplate ;
  $(document).ready(function(){
    divTagTemplate = document.getElementById('addVal1').cloneNode(true);
 $('#addFileButton').click(function() {

  var divTagTemplateCopy = divTagTemplate.cloneNode(true);
  var innerinVal = ++intVal;
  divTagTemplateCopy.setAttribute("id",'addVal'+innerinVal);

  var stringVal = divTagTemplateCopy.innerHTML;
  stringVal = stringVal.replace(/MultiFile1/g,"MultiFile"+innerinVal);
  divTagTemplateCopy.innerHTML = stringVal;
  var divTagVal = divTagTemplateCopy.cloneNode(true);
  //divValList = divTagVal.getElementByTagName('input');
  document.getElementById('outerVal').appendChild(divTagVal);
  });

 });

  </script>

<script language="javascript">
var intVal = 2;

</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-->
<div id="addVal1">
Please specify a file, or a set of files:<br>
<input type="file" class="multi" name="datafile" size="40">
</div>
<div id="addVal2">
Please specify a file, or a set of files:<br>
<input type="file" class="multi" name="datafile" size="40">
</div>
<div>
<input type="submit" value="Send">
<input type="button" class="button" value="Add File" id="addFileButton" />
</div>
</div>

</form>
<script>


</script>

</html>

Reply via email to