bigracefan
Programmer
I'm trying to do a "Are you sure?" thing and it's not working the way I expect.
Here's the code where I get the alert to work:
The following, the way I thought it works, doesn't fire the alert.
What I'm looking for is it to continue submitting on "ok" and to not do anything if "cancel". What am I missing? Almost no hair left, pulled it all out!
Here's the code where I get the alert to work:
Code:
<script type="text/javascript">
function Validate()
{
var answer = confirm ("Are you sure you want reinstate?")
if (answer)
{//ok
return true;
}
else
//cancel
{
return false;
}
}
</script>
<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgColor="#5f9ea0" )>
<table cellSpacing="0" cellPadding="0" width="595" align="center" border="0">
<tr>
<td colspan="3" align="middle">
<form METHOD="POST" ACTION="frmreinstate.asp" id="reinstatefrm" onSubmit="Validate()" name="reinstatefrm"><p>
<input type="hidden" id="radio1" name="radio1" value="1">
<div align="center">
<center>
The following, the way I thought it works, doesn't fire the alert.
Code:
<script type="text/javascript">
function Validate()
{
var answer = confirm ("Are you sure you want reinstate?")
if (answer)
{//ok
return true;
}
else
//cancel
{
return false;
}
}
</script>
<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgColor="#5f9ea0" )>
<table cellSpacing="0" cellPadding="0" width="595" align="center" border="0">
<tr>
<td colspan="3" align="middle">
<form METHOD="POST" ACTION="frmreinstate.asp" id="reinstatefrm" onSubmit="Return Validate();" name="reinstatefrm"><p>
<input type="hidden" id="radio1" name="radio1" value="1">
<div align="center">
<center>
What I'm looking for is it to continue submitting on "ok" and to not do anything if "cancel". What am I missing? Almost no hair left, pulled it all out!