So I have a forms on a html page which retrieve data from a mysql table. The user can modify these data, or delete the entire row. I have a html button with functionality of deleting the entire row, and with that button I have a javascript function that displays a confirm pop up box confirming if the user wants to delete it. If they click yes then it is sent to another php page where the deletion is performed. The problem is when I click on the confirm box nothing happens, it just stays on the same page. Here is my html and javascript code:
<form class="form-inline" method=GET action="envoieModifierAlbumAdmin.php">
<table class="table table-striped">
<tr>
<td><button type="button" class="btn btn-danger" onclick="verif()">Supprimer Cet Album</button>
</td><td></td><td></td>
</tr>
<tr>
<td><label for="exampleInputName2">id: </label>
<input readonly type="text" class="form-control" value="<?php echo "$donnees[id]"?>" id="exampleInputName2" name="id">
</td><td></td><td></td>
</tr>
<tr>
<td><label for="exampleInputName2">Nom d'album: </label>
<input type="text" class="form-control" id="exampleInputName2" name="titre" value="<?php echo "$donnees[titre]"?>"></td>
<td></td><td></td>
</tr>
</table>
</form>
<script>
function verif(){
var x;
if(confirm("Vous êtes sûr que vous voulez supprimer ce compte?") == true){
document.location="supprimerAlbumAdmin.php?id=$_GET['id']";
}
else
}
</script>
The only problem is with the button, the other parts of the table above are just to show an example of what the user is modifying. Thanks in advance!