I am trying to validate a delete link using the following javascript code that I have typed in the head section of the script.
<script language="Javascript">
var goTo;
function verifyClick(goTo)
{
var choice;
choice = confirm("Are you sure you want to delete this entry?");
if (choice)
{
window.location = goTo;
}
}
After this, I am calling the fuction in the following way within PHP.
print("<td><a href=onClick='return verifyClick('delete.php?row=$deleteid')'>Delete</a></td>");
Within the loop I assign the rowid from the database to $deleteid that's being used.
The problem is that when I click on the Delete link I get a message "error on page"
Please help.