erot
asked on
JavaScript, Alert...Yes No not only OK ???
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?
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?
ASKER
Great stuff....thanks!
Erot / Norway
Erot / Norway
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I see the autograding is working again. Nice. Too bad it has to be used though.
Martin
Martin
answer = confirm("Yes or no?");
if (answer == true)
pressed = "yes";
else
pressed = "no";
alert('You pressed "' + pressed + '".');
Martin