Tarik Tutuncu - 2006-05-24 13:22:10 -
In reply to message 2 from Er. Rochak Chauhan
I have checked everything you said.
I got the same error even when I uploaded your script without doing any changes.
The problem is when I create 3 file upload instances with:
echo $ajaxFileUploader->showFileUploader('id1');
echo $ajaxFileUploader->showFileUploader('id2');
echo $ajaxFileUploader->showFileUploader('id4');
the first one doesn't work even if I change the id number. And also when I use only one of them it still doesn't work. I get the same error.
It shows 3 file upload forms. But the first one never works. No matter how many I show or if I change the id's, the first one always complaints having an empty object.name.
It works for all but the first form. And the other two forms act wierdly.
I have tested the script with both Firefox and IE
I've compared the code with the stand-alone version and really can't find any differences.
I guess somehow that first instance is clashing with other code on that page.
The second and third work regardless of whether you actually try the first one. The first doesn't work after successfully using the second or third either.
I have tested the first instance
it enters function uploadFile(obj)
then I put alerts for obj.name and obj.value and it shows the id name and value correctly, but when it comes to document.getElementById('formName'+obj.name).submit();
it stops and throws a javascript error.
Error: document.getElementById("formName" + obj.name) has no properties
Source File: http://***
Line: 41
Any ideas?
Thanks