[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

JavaScript, Alert...Yes No not only OK ???

Posted on 1998-12-21
4
Medium Priority
?
7,966 Views
Last Modified: 2008-06-24
When the client hit a button on a page I want to ask him
a question. I want to display a messagebox with two buttons,
Yes and No. And I want the client script to be able to
check if the user hit Yes or No. Is this possible? Example
code please?
0
Comment
Question by:erot
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 4

Expert Comment

by:martinag
ID: 1840927
confirm("String"). Here's an example:

answer = confirm("Yes or no?");
if (answer == true)
  pressed = "yes";
else
  pressed = "no";
alert('You pressed "' + pressed + '".');

Martin
0
 

Author Comment

by:erot
ID: 1840928
Great stuff....thanks!

Erot / Norway
0
 
LVL 4

Accepted Solution

by:
martinag earned 200 total points
ID: 1840929
Here's an answer for you to grade.

Martin
0
 
LVL 4

Expert Comment

by:martinag
ID: 1840930
I see the autograding is working again. Nice. Too bad it has to be used though.

Martin
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question