I am working on a project , the situation is , the client has to enter the details , and after he enters the details , with java script ( confirm dialogue ) , i m showing all the important details for verification , then when he press ok, the form get submitted.
this is what i have made , but seems it is not working... need help ...
( after pressing cancel .. the dialog box keeps on coming .. and worst part is finally the form get submitted even if i have selected cancel )
( i have removed other details ...)
<script type="text/javascript">
function validateMyForm()
{
var X=confirm("ARE DETAILS CORRECT ??");
if(!X)
{
alert("validation failed false");
returnToPreviousPage();
return false;
}
else
{alert("validations passed");
return true;}
}
</script>
<form name="frm" action=<?php print "new_update_attendence.php"; ?> method="POST"
id="content" onsubmit="return validateMyForm();">