M
Martin Nadoll
Hello,
i want a user-form for file upload.
i dont know, how many files the user want to upload, so i want to start with
only three buttons:
<table id="imgbin" colspan="2"><tr><td>
<input type="button" onclick="insertInput('imgbin','Bild')" value="add img">
</td></tr></table>
<table id="videobin" colspan="2"><tr><td>
<input type="button" onclick="insertInput('videobin','Video')" value="add
video">
</td></tr></table>
<table id="swfbin" colspan="2"><tr><td>
<input type="button" onclick="insertInput('swfbin','Flash')" value="add
flash">
</td></tr></table>
<script>
var bildnr = 0;
var videonr = 0;
var swfnr = 0;
function insertInput(id,f) {
var zahl='';
if(f=='Bild') { bildnr+= 1; zahl=bildnr; }
if(f=='Video') { videonr+= 1; zahl=videonr; }
if(f=='Flash') { swfnr+= 1; zahl=swfnr; }
var x=document.getElementById(id).insertRow(zahl+1);
var y=x.insertCell(0);
var z=x.insertCell(1);
y.innerHTML=f;
z.innerHTML+="<input type=\"file\" name=\""+f+zahl+"\">";
}
</script>
now. when i click my "add file", a new <tr> appears with my <file>-field.
everything ok so far.
i expected to generate:
<file type="file" name="Bild1">
<file type="file" name="Bild2"> and so on...
but when i submit my form, there is no "post"-data transfered to my next
page.
do i have the wrong idea here?
maybe , someone can help me, maybe to improve my idea or to lead me to a
other, better solution.
thanks a lot,
martin nadoll
i want a user-form for file upload.
i dont know, how many files the user want to upload, so i want to start with
only three buttons:
<table id="imgbin" colspan="2"><tr><td>
<input type="button" onclick="insertInput('imgbin','Bild')" value="add img">
</td></tr></table>
<table id="videobin" colspan="2"><tr><td>
<input type="button" onclick="insertInput('videobin','Video')" value="add
video">
</td></tr></table>
<table id="swfbin" colspan="2"><tr><td>
<input type="button" onclick="insertInput('swfbin','Flash')" value="add
flash">
</td></tr></table>
<script>
var bildnr = 0;
var videonr = 0;
var swfnr = 0;
function insertInput(id,f) {
var zahl='';
if(f=='Bild') { bildnr+= 1; zahl=bildnr; }
if(f=='Video') { videonr+= 1; zahl=videonr; }
if(f=='Flash') { swfnr+= 1; zahl=swfnr; }
var x=document.getElementById(id).insertRow(zahl+1);
var y=x.insertCell(0);
var z=x.insertCell(1);
y.innerHTML=f;
z.innerHTML+="<input type=\"file\" name=\""+f+zahl+"\">";
}
</script>
now. when i click my "add file", a new <tr> appears with my <file>-field.
everything ok so far.
i expected to generate:
<file type="file" name="Bild1">
<file type="file" name="Bild2"> and so on...
but when i submit my form, there is no "post"-data transfered to my next
page.
do i have the wrong idea here?
maybe , someone can help me, maybe to improve my idea or to lead me to a
other, better solution.
thanks a lot,
martin nadoll