I want to make a confirm box. If someone clicks OK, the form is submitted, if clickes Cancel nothing happends.
This is what I have so far:
Code: Select all
<script language="JavaScript">
<!--
function confirm_entry()
{
var agree=confirm("OK to Continue \r Cancel to stop the execution");
if (agree)
{
// when ok is pressed the form is submitted
}
else
{
// when cancel is pressed nothing happends
}
}
-->
</script>
<form name="" action="test.php" method="post" onSubmit="confirm_entry();">
<input type="submit">
</form>