I have some JavaScript for an alert box that is for use within an anchor tag:
<head>
<script language="javascript" type="text/javascript">
<!--
function alertURL(url) {
if(confirm("Are you sure you want to delete the project?"))
{
location=url
}
}
//-->
</script>
</head>
<body>
<a href="#" onClick="alertURL('delete_record.php?prop=<?php echo $getID; ?>')">Delete Project</a>
</body>
My problem is I need it work within the confines of an html button. This is how the button code looks right now (w/o the alert box functionality):
<input type=button onClick="parent.location='delete_record.php?prop=<?php echo $getID; ?>'">
If I change it to:
<input type=button onClick="alertURL('delete_record.php?prop=<?php echo $getID; ?>'">
then it doesn't call the alert/warning box. Any suggestions from JavaScript gurus is appreciated.