I have a form that should redirect the user to a page when clicking the Delete button. This is the only object in the form.
<input type="submit" name="delete" value="Delete" class="submitbutton" id="submitbutton" onclick="Redirect();">
Unfortunately the redirect is not working:
<script type="text/javascript">
function Redirect()
{
alert('b');
window.location="http://www.tutorialspoint.com";
}
</script>
The alert is displayed. Then nothing happens. I also tried window.navigate. I am pulling my hairs out.
There is a session in the beginning of a page if that matters:
<?php
session_start();
?>
<html>...
I tried in chrome and firefox. I am clearly missing something.
It was in front of my eyes the whole time:
The accepted solution on this page:
Try to combine javascript confirm box with php post method?