0
Code blocks are created by indenting at least 4 spaces
... and can span multiple lines

<script>
function del(delUrl) {
var r=confirm("Are you sure you want to delete?");
if (r==true)
  {
  alert("Deleted record!");
  document.location = delUrl;
  }
else
  {
  alert("Delete cancel!");
  }
}
</script>



<a href='delete.php?id=$sysid' class='view' onClick='del()'>
                    <img src='image/vie.png' border='0'>
                </a>

can someone tell where im wrong to this javascript...
this code pass the id=$sysid to the delete.php but before to pass i make dialogbox yes and no.
but this code alway sent me to the next page. help plsssss

3
Contributors
3
Replies
5
Views
5 Years
Discussion Span
Last Post by veedeoo
0

Try this

<a href='JavaScript:void(0);' class='view' onClick='del("delete.php?id=$sysid")'>
                <img src='image/vie.png' border='0'>
            </a>
0

Hi,

if this-> $sysid is a php variable, then try changing your code

<a href='delete.php?id=$sysid' class='view' onClick='del()'>
<img src='image/vie.png' border='0'>
</a>

to this

<a href='delete.php?id=<?php echo $sysid;?>' class='view' onClick='del()'>
<img src='image/vie.png' border='0'>
</a>

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.