Why is my Javascript not valid?
<p>Can anyone please help?<br> 
I have a div with ID 'adpictureholder', to which I dynamically add (or remove) images.<br>
 On Form submit I want to get SRC values of all these images within that DIV and put them to the value of one hidden input with ID 'piclinkslisttosubmit'. <br> The thing is that my current Javascript does not function, as if there is some syntax typo there, but I don't see where. <br>Can anyone please have a quick look at it?</p>

<pre><code>function copyonsubmit(){
    var strump1 = '';
    var i=0;
    var endi = document.getElementById('adpictureholder').childNodes[].length - 1;
    var images = document.getElementById('adpictureholder').childNodes[];
    for (i=0;i&lt;=endi;i++)
    {
        strump1 = strump1 + '|' + images[i].src;
    } 
    document.getElementById('piclinkslisttosubmit').value = strump1;
}   
</code></pre>
