I have a form with two list boxes. One list box contains all products, the other containing the products which the user has selected.
List box (A) is called "allproducts".
List box (😎 is called "selectedproducts".
I have a javascript function:
function tccMoveItem(SourceList, DestinationList) {
for(var i=0; i<SourceList.options.length; i++) {
if(SourceList.options[i].selected && SourceList.options[i].value != "") {
var no = new Option();
no.value = SourceList.options[i].value;
no.text = SourceList.options[i].text;
DestinationList.options[DestinationList.options.length] = no;
SourceList.options[i].value = "";
SourceList.options[i].text = "";
}
}
tccMoveUp(SourceList);
}
This function moves the selected product from list (A) to list (😎. This works OK.
When the form is submitted via a button, My PHP script should be able to detect the array $selectedproducts (the name of the second list box), but is DOES NOT.
If I change the name to "$selectedproducts[]", my javascript fails. I suspect it is because I am passing the array through to my JS function rather than the name of the object.
Can anyone help me please????????
Many thanks
BB :-)