Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Yes or No Confirmation alert Msg Box??

 
Bikash Paul
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all friends,
I want to pop up a confirmation alert msg box with "Yes" or "No" button.If user click on "yes" it should go to previous page and in case of "No" button it should close the browser window.Now I have done this but with my code alert msg box showing "Ok" and "Cancel" button.I want "yes" and "No" button in place of "Ok" and "Cancel" button.Can any one plz guide me how I can slove this problem.Below r my codes:-
<script>
var agree=confirm("Game Over Your Total Score is " + score +" "+"Points"+"\n"+
"Do You Want To Play Again?"+"\n"+"(OK = Yes , Cancel = No)");
if (agree)
history.go(-1);
else
window.close();
</script>
Regards
Bikash
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can not change the properties of a confirm box
 
Bikash Paul
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Al Ian,
Is there any other way to do that.Can u Plz tell me how can I use ur given code for'customize confirmation alert msg box' on ur site (http://www10.brinkster.com/A1ien51/Scripts/ConfirmBuilder.htm) in my programe coz I don't want to use on_click.In ur code U pop up 'confirmation alert msg box box' on 'on_click' event.I want to add it in my function without on_click event.Below r my codes:-
function isGameOver(){
for(var prop in itemZones){
if( itemZones[prop].item.style.visibility == "visible"){
return;
}
}
gameOver = true;
//I WANT TO ADD UR CODE HERE......
//NOW HERE I AM USING MY ABOVE CODES.
if( itemBig ) itemBig.style.visibility = "hidden";
if( isGameOverId )clearInterval(isGameOverId);
}
Regards
Bikash
[ October 04, 2002: Message edited by: Bikash Paul ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic