Im a little new to JavaScript.
I am going to have a file upload field. I want to add an onclick to the file upload field to add additional file upload fields.
So I’m thinking something like:
i=0
function addfile() {
document.getElementById("form_name").appendChild(<input type=\"file\" name=\"file1\"" + "i++" + " />)}
…then…
<input type="file" onclick="addfile();" />
(I know this syntax is probably terrible/missing things, I’m just trying to layout the concept I think I am supposed to be using.)
Can you get this working?
This encapsulates the
ivariable.jsFiddle.