My problem is that i have to delete something out of an array. I found out how to delete something out of a listbox. But the problem is that the listbox is filled by an array. So if I don't delete the value (I deleted out of the listbox) out of the array. The value keeps coming back when you add a new item. BTW: I am new to php and javascript.

My code is:

```
function removeItem(veldnaam){
var geselecteerd = document.getElementById("lst"+veldnaam).selectedIndex;
var nieuweArray;
alert(geselecteerd);    
alert(document.getElementById(veldnaam+'hidden').value);

For (var i = 0, i<= arr.lenght, i++) {
If (i= geselecteerd){
    nieuweArray = arr.splice(i,1);
    document.getElementById(veldnaam+'hidden').value = arr;
                }}

document.getElementById("lst"+veldnaam).remove(geselecteerd);
    }

```