Monday 24 October 2011

javascript for conformation on deleting


<script LANGUAGE="JavaScript">
<!--
function confirmSubmit(ttt,id) {
var msg = "Are you sure you want to delete the data ? " + ttt + " - ID= "+id;
var agree=confirm(msg);
if (agree)
return true ;
else
return false ;
}
// -->
</script>



<td><a onClick="return confirmSubmit('<?php echo $row['id']; ?>','<?php echo $row['name']; ?>')" href="delete.php?id=<?php echo $row['id']; ?>"><strong>Delete</strong></a></td>