confirm box
Posted: Fri Sep 03, 2004 6:03 pm
hello. pl help with the follwing;
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:
in this situation, if I click ok, the form is submitted, but the same thing is happening if i click cancel
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>