Everything below works fine, except that the form doesnt get submitted... it seems the problem lies in the 'x.onchange' event... any tips?
var form = document.forms['pic_form'];
var x=document.createElement("input");
x.type="file";
x.name="pic_file2";
x.id="pic_file2";
x.size="35";
x.onchange="pic_form_function(form, 1);";
var z=document.getElementById("pic_file2");
z.parentNode.replaceChild(x, z);
here is the function called:
pic_form_function(formName, nr){ if (nr==1){formName.submit(); }}
It wont submit, but it DOES get replaced and all... help please!