That is how a listbox works. You can then retrieve the selected items from the form field.
However, if you really want to modify the list box contents, I would add a button to trigger that process (otherwise, you will end up with users accidentally deleting the list box content or major portions of it). You can then use something like this script as the button action:
var newList = [];
f = this.getField("ListBox1");
var a = f.currentValueIndices;
if (typeof a == "number") // A single selection
newList.push(f.getItemAt(a, false));
else { // Multiple selections
for (var i = 0; i < a.length; i ++) {
newList.push(f.getItemAt(a[i], false));
}
}
f.setItems(newList);
Again, this is not how list boxes normally work, and I would advise against modifying what people expect the behavior to be.
Karl Heinz Kremer
PDF Acrobatics Without a Net
PDF Software Development, Training and More...
http://www.khkonsulting.com