I have the following JS functions:
Code:
function GetDisplayName(path)
{
var i;
if (
(i = path.lastIndexOf("\\")) != -1
||
(i = path.lastIndexOf("/")) != -1
) {
return i < path.length ? path.substring(i + 1) : "";
}
return path;
}
Code:
function BeginAttach()
{
var path = document.filesform.userFile.value;
var displayName = GetDisplayName(path);
self.opener.document.foo.attach1.value = displayName;
self.opener.document.foo.submit();
self.close();
}
the parent page has 10 hidden input field, something like:
Code:
<input type="hidden" name="attach1" value="">
<input type="hidden" name="attach2" value="">
etc..
In child window I have 10 file input field :
Code:
<input type="file" name="userFile[]" size="20">
<input type="file" name="userFile[]" size="20">
etc..
I don't really know what I need to do to send the file name of each "file" field to parent page.
Code:
self.opener.document.foo.attach1.value = 'FileName1';
self.opener.document.foo.attach1.value = 'FileName2';
Any idea?