Thanks Kong, but it doesn't redirect even if I use an absolute url for the destination.
The following code is in the head section of a page called viewevent.php:
Code:
<script language="JavaScript" type="text/JavaScript">
function DeleteEvent(id, name)
{
var eventid= id;
var eventname= name;
var deleteconfirm= confirm("Do you really want to delete event: "+eventid+" - "+eventname+"?");
if (deleteconfirm== true) {
window.location.replace("deleteevent.php?eventid="+eventid);
}
}
</script>
The function is triggered by various links further down in the body of the page:
Code:
<td id="link"><a href="" onclick="DeleteEvent('$id','$name')">Delete</a></td>
$id and $name are php variables
The destination deleteevent.php is located within the same directory as viewevent.php.
---
Vinod
I had already tried using window.location, but I did try using your script just to be sure, unfortunately it still didn't solve the problem. I'm using the latest versions of IE and Firefox so that shouldn't be the issue, although it's definitely a good idea for older compatibility.
----
So anyone got any other ideas?