Meinst Du so etwas?
PHP-Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Malleus Test</title>
<script type="text/javascript">
var controlCounter=1;
function check4NewControl(myControl)
{
if (myControl.value)
{
var newFileControl=document.createElement("input");
newFileControl.setAttribute("type","file");
newFileControl.setAttribute("name","file"+(++controlCounter));
newFileControl.onchange=function(){check4NewControl(this)};
myControl.form.appendChild(document.createElement("br"));
myControl.form.appendChild(newFileControl);
}
}
function checkIt()
{
var myElements=document.forms[0].elements;
for (var i=0;i<myElements.length;i++)
alert(myElements[i].name+":"+myElements[i].value);
}
</script>
</head>
<body>
<button onclick="checkIt()">checkIt</button>
<form>
<input type="file" name="file1" onchange="check4NewControl(this)">
</form>
</body>
</html>
Testlink
Wenn Du etwas nicht verstehst, einfach nachfragen!
tschau
Frank