Hey guys,
Wondering if anyone can help. I've got a Javascript function that will confirm the removal of an object, invoked via a hypertext link.
By clicking on the hyperlink, the details will be passed to another script to be removed from a datastore. However, before this happens, I wanted a confirmation prompt. I have this function working in other pages but can't understand why I cannot access the Javascript confirm method. Can anyone help? Why is it working in some pages and not others? Am I messing up the scope of the script tags?
e.g.
This code snippet is placed within a table.
echo ("<a href='RemoveChemicalStock.php?i=$i&k=$k'
onClick='return doConfirm() ;' >") ;
This is placed at the very bottom of the page.
<script language=Javascript>
function doConfirm() {
var confirmation = false ;
var reply = window.confirm("Are you sure you wish to remove
this chemical stock instance ?\n") ;
if (reply==true) {
confirmation = true ;
} // end if
return confirmation ;
} // end doConfirm()
</script>