Hey,
Ok using the following code for deleting items:
<a href=\"javascript:;\" onclick=\"confirmDelete('" .$row['fld_id'].",".$section."')\">Delete</a></p>
Reason for the slashes is because it's inside an echo.
Anyway, as you can see I am using Javascript to ask if they are sure they want to delete - here is the code:
function confirmDelete(id,section) {
if (confirm('Are you sure you want to delete this entry?')) {
window.location = ('admin.php?section=' + section'&type=delete&id=' + id);
} else {
return false;
}
}
Now, first of all I don't think the javascript is correct. I have different sections that all use the same kind of code to delete, but I don't want to have to create different delete functions for each section, I'd rather pull the name of the section so they can all use the same function.
Any ideas why I am getting an error - it says:
expected ')'
Seems as if I am not putting the variables correctly in the javascript code?
Also when I did get it to work without the sections, it put in something like this for the $id:
fld_id=11,categories - it's putting the id number and the section name in the same variable??
Can anyone help me out here, totally stuck 🙁
Cheers,
Chris