create an javascript alert before linking to a new php page
Posted: Wed Sep 12, 2012 5:46 am
I have a image button that links through to a new page but i need an alert to popup before the page is viewed but i am getting an error i have so far
<script type="text/javascript">
<!--
function navConfirm(loc) {
if (confirm('your have 72 to ours to query the document')) {
window.location.href = loc;
}
return false; // cancel the click event always
}
//-->
</script>
<a href="../admin/docs/<?php echo $row_Recordset1['Inventory']; ?>" onclick="return navConfirm(this.ref);" target="_new"><img src="../images/smalldownload.png" width="35" height="35" alt="download" /></a>
but when i run it i get the following error page
The requested file http://www.website.com/beta/signup-login/undefined does not exist on the web server, it may be a misspelling or perhaps it was removed in a website restructure.
thanks in advance
<script type="text/javascript">
<!--
function navConfirm(loc) {
if (confirm('your have 72 to ours to query the document')) {
window.location.href = loc;
}
return false; // cancel the click event always
}
//-->
</script>
<a href="../admin/docs/<?php echo $row_Recordset1['Inventory']; ?>" onclick="return navConfirm(this.ref);" target="_new"><img src="../images/smalldownload.png" width="35" height="35" alt="download" /></a>
but when i run it i get the following error page
The requested file http://www.website.com/beta/signup-login/undefined does not exist on the web server, it may be a misspelling or perhaps it was removed in a website restructure.
thanks in advance