Hi -
I know this has been asked before, but when I tried others suggestions, they just didn't work for me...(though I'm probably just doing something wrong.)
I'm trying to confirm a submit in javascript. Basically, after clicking "submit", the user will get prompted to confirm the submission of the form. If they click "OK", take them to one page, if they click "Cancel" take them to another page.
Here is my code so far:
<SCRIPT LANGUAGE="JavaScript">
function confirmGo()
{
if(confirm('The data above will now be saved.\nClick OK to Save and Generate Reports, or Cancel to Exit'))
document.StaffDelivered.submit();
else
location.href="StaffDelivered.asp";
}
</SCRIPT>
<form name="StaffDelivered" method="post" action="StaffDelivered3.asp">
CODE...
...
...
<center><input type="submit" value=" Go " onClick="confirmGo()" name=" submit">
</form>
Sorry if this looks really funky, but I'm a newbie at Javascript. Any help or suggestions are greatly appreciated!
-DVD Girl
I know this has been asked before, but when I tried others suggestions, they just didn't work for me...(though I'm probably just doing something wrong.)
I'm trying to confirm a submit in javascript. Basically, after clicking "submit", the user will get prompted to confirm the submission of the form. If they click "OK", take them to one page, if they click "Cancel" take them to another page.
Here is my code so far:
<SCRIPT LANGUAGE="JavaScript">
function confirmGo()
{
if(confirm('The data above will now be saved.\nClick OK to Save and Generate Reports, or Cancel to Exit'))
document.StaffDelivered.submit();
else
location.href="StaffDelivered.asp";
}
</SCRIPT>
<form name="StaffDelivered" method="post" action="StaffDelivered3.asp">
CODE...
...
...
<center><input type="submit" value=" Go " onClick="confirmGo()" name=" submit">
</form>
Sorry if this looks really funky, but I'm a newbie at Javascript. Any help or suggestions are greatly appreciated!
-DVD Girl