Hello. I have the following function:
I call it like this:
but it doesnt seem to work. I think that the problem is a very simple syntax thing, but I'm a beginner in JS and it's killing me.
Many thanks!
Code:
function delProd(codproddel, rowNr) {
var agree=confirm("Esti sigur ca vrei sa stergi produsul?");
if (agree)
{
var elTRdel = $('produse').insertRow( -1 );
var cell5 = elTRdel.insertCell( -1 );
//cell5.setAttribute("colspan","7");
var inp5 = document.createElement("input");
inp5.setAttribute("type","hidden");
inp5.setAttribute("name","deletedprod[]");
inp5.setAttribute("value",+codproddel+);
cell5.appendChild(inp5);
document.getElementById('produse').deleteRow(rowNr);
}
else
{
return false;
}
}
I call it like this:
Code:
<input type='button' value='Delete' onclick="return delProd(<?=$codproduscom?>,this.parentNode.parentNode.rowIndex);">
but it doesnt seem to work. I think that the problem is a very simple syntax thing, but I'm a beginner in JS and it's killing me.
Many thanks!
Comment