echo $accessory['name'].'<span onclick="delAccessory('.$accessory['id_product'].');" style="cursor: pointer;"><img src="../img/admin/delete.gif" /></span><br />';
linia 1775 w AdminProduct.php odpowiada za to;
czyżby błąd w funkcji pliku admin.js:
function addAccessory()
{
var valueToAdd = $('#selectAccessories').val();
if(valueToAdd == '0')
return false;
var $divAccessories = $('#divAccessories');
var $inputAccessories = $('#inputAccessories');
var $nameAccessories = $('#nameAccessories');
var valuesToAdd = valueToAdd.split('-');
var productId = valuesToAdd[0];
var productName = valuesToAdd[1];
/* delete product from select + add product line to the div, input_name, input_ids elements */
$('#selectAccessories option[value='+valueToAdd+']').remove();
$divAccessories.html($divAccessories.html() + productName + ' <span onclick="delAccessory(' + productId + ');" style="cursor: pointer;"><img src="../img/admin/delete.gif" /></span><br />');
$nameAccessories.val($nameAccessories.val() + productName + '¤');
$inputAccessories.val($inputAccessories.val() + productId + '-');
}
function delAccessory(id)
{
var div = getE('divAccessories');
var input = getE('inputAccessories');
var name = getE('nameAccessories');
console.log('---');
console.log(input);
console.log('___');
console.log(name);
var reg = new RegExp('-', 'g');
var inputCut = input.value.split(reg);
var reg2 = new RegExp('¤', 'g');
var nameCut = name.value.split(reg2);
input.value = '';
name.value = '';
div.innerHTML = '';
for (var i = 0; i < inputCut.length; ++i)
if (inputCut[i] && inputCut[i] != id)
{
input.value += inputCut[i] + '-';
name.value += nameCut[i] + '¤';
div.innerHTML += nameCut[i] + ' <span onclick="delAccessory(' + inputCut[i] + ');" style="cursor: pointer;"><img src="../img/admin/delete.gif" /></span><br />';
}
}