See here:

http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_AJAX_request.3F

And you're loading the MultiFile plugin twice. You need either
MultFile.js or MultiFile.pack.js, but not both.

Also, keep in mind that you're cloning an element with an ID, which
must always be unique.

But it looks to me like you're trying to do something that's
unnecessary. Why are you cloning anything at all?

On Mon, Dec 7, 2009 at 2:45 PM, jayakumar ala <alajay...@gmail.com> wrote:
> 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