Forum Moderators: open
<script LANGUAGE="JavaScript">
function confirmSubmit()
{
var agree=confirm("Confirm: Do this?");
if (agree)
return true ;
else
return false ;
}
</script>
==============
In your form/button/whatever:
onClick="return confirmSubmit()"
make sure you do the "return" part of that - if you just do onClick=confirmSubmit() it will always default to the "OK" and not the cancel. Having return in there allows for "nothing" to happen if the user clicks cancel.