...

View Full Version : Confirmation Script not working correctly



SuzyQueue
07-30-2008, 09:19 PM
Hello,

I have a confirmation script that I am using with a php page which asks the user if they are sure if the order is correct and to continue to process or go back and change it. Here is the script:


<script type="text/javascript">
<!--
// Confirmation of order before values are passed to the database
// onclick event

function confirmation() {
var answer = confirm("Are you sure your order is correct?")
if (answer){
alert("Click OK to Continue")
window.location = "menu.php";
}
else{
alert("Please click OK to change your order.")
}
}
//-->
</script>

As I'm sure the guru's see it immediately :) this newbie is not sure why it continues to process the script when the cancel is selected. I just want it to stay on the page and let them change their selections.

Any help is appreciated. Thanks in advance.

Philip M
07-30-2008, 09:41 PM
Hello,

I have a confirmation script that I am using with a php page which asks the user if they are sure if the order is correct and to continue to process or go back and change it. Here is the script:


<script type="text/javascript">
<!--
// Confirmation of order before values are passed to the database
// onclick event

function confirmation() {
var answer = confirm("Are you sure your order is correct?")
if (answer){
alert("Click OK to Continue")
window.location = "menu.php";
}
else{
alert("Please click OK to change your order.")
}
}
//-->
</script>

As I'm sure the guru's see it immediately :) this newbie is not sure why it continues to process the script when the cancel is selected. I just want it to stay on the page and let them change their selections.

Any help is appreciated. Thanks in advance.


else{
alert ("Please click OK to change your order.");
return false;
}

SuzyQueue
08-02-2008, 05:09 AM
Thank you. I have my preferences set to receive emails for any replies but never got notice. Sorry for being late on replying. All your input and help is very much appreciated. I really don't know what I would do without these forums and the nice people who care enough to reply.

Thanks again!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum