File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes JavaScript confirm with Yes/No Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "JavaScript confirm with Yes/No" Watch "JavaScript confirm with Yes/No" New topic
Author

JavaScript confirm with Yes/No

Jyothish Divakar
Greenhorn

Joined: Feb 12, 2007
Posts: 10
I need to create a confirm box in javascript with yes/no options. is it possible without using VB script?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61762
    
  67

Please take the time to choose the correct forum for your posts. This forum is for questions on JSP.

This post has been moved to a more appropriate forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You can create a div that looks like a prompt box and display it on top, other than that there is no way to do it. I think in this day in age peopla are using to the buttons of confirm and cancel.

Eric
sudha swami
Ranch Hand

Joined: Apr 24, 2007
Posts: 179
Hi,
How about this?

var flag=confirm("Are you sure you would like to delete this record?","Yes","No");

regards
sudha
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61762
    
  67

Originally posted by sudha swami:
var flag=confirm("Are you sure you would like to delete this record?","Yes","No");

What exactly is that supposed to do?
sudha swami
Ranch Hand

Joined: Apr 24, 2007
Posts: 179
Hi,
It will come up with the message "Are you sure you want to delete ..." with OK and Cancel button. If the user clicks OK then it will be interpreted as true otherwise false. If true, the form can be submitted so that the record can be deleted on the server side. If false, it will be remain in the same screen.
regards
sudha
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Originally posted by sudha swami:
Hi,
It will come up with the message "Are you sure you want to delete ..." with OK and Cancel button. If the user clicks OK then it will be interpreted as true otherwise false. If true, the form can be submitted so that the record can be deleted on the server side. If false, it will be remain in the same screen.
regards
sudha


He knows how the confirm works....
If you read the post he wants a confirm with yes an no buttons.
Your previous post with the "Yes","No" does nothing to help since the confirm accepts one argument.

Eric
sudha swami
Ranch Hand

Joined: Apr 24, 2007
Posts: 179
I got it
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JavaScript confirm with Yes/No