javascript, a little coding help, cant figure this out
<p>Everything below works fine, except that the form doesnt get submitted... it seems the problem lies in the 'x.onchange' event... any tips?</p>

<pre><code> 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);
</code></pre>

<p>here is the function called:</p>

<pre><code>    pic_form_function(formName, nr){ if (nr==1){formName.submit(); }}
</code></pre>

<p>It wont submit, but it DOES get replaced and all... help please!</p>
