I'm using some href tabs to draw buttons across all the rows in an html table. When the user clicks the row button it will redirect user to another PHP script with some row values using HTML GET. But in my current implementation when user clicks the button there is no confirmation. I added the basic javascript confirmation box, but it was pretty basic and the browser asks to stop popping up alerts every time.
So, instead of using plain javascript I found library called bootbox.js
that is specially designed for CSS alerts and confirmation boxes. But when I apply bootbox methods with my current jquery implementation it doesn't work!
bootbox - bootbox docs
Below is my code:
This is my href code that makes the html link
echo "<a href='approveone.php?id=$lvid&empno=$empno<ype=$leavetype&hmd=$leavehmd&dprtmnt=$empdepartment&adminname=$adminusername' class='btn btn-success btn-xs m-r-1em confirmation' >Approve</a>";
and here is my jQuery code part that contains the bootbox call.
<script type="text/javascript">
$('.confirmation').on('click', function () {
return bootbox.confirm('Are you sure?');
});
</script>