Jump to content

Making a pop up window question?


Recommended Posts

How can I go about making a popup window appear and ask

Title would say "Changes Detected"

With a question "What do you want to do?"

with option "Save" , "Discard" , and "Cancel"

and

if "Save" goto function "opsave"

if "Discard" goto function "opdiscard"

if "Cancel" goto function "opcancel"

because I would have

function opsave() {
"My Code"
}
function opdiscard() {
"My Code"
}
function opcancel() {
"My Code"
}

I know it might be some easy code but for some reason I can't find info on this.

I found the code

alert(Do You want to save changes?);

but it only make a "OK" button

Thank for your help.

Edited by almulder
Link to comment
Share on other sites


Well thank you both. That helps a bit, but that brings up just a "OK" or "Cancel" buttons. I know I can have Yes, No,and Cancel Buttons but can't seem to find the correct code. I have seen it a while back but I cant find the correct lingo for do a good search of examples of it.

I keep looking if you will. LOL

Thank you.

Link to comment
Share on other sites

Javascript can't do that, as far as I know. You can use a DIV layer with the appropriate buttons a la Gmail's "report phishing" option.

Also, sorry for not responding on YIM. I wasn't home. Just got home. Long day. Gonna hit the hay.

Edited by Dumpy Dooby
Link to comment
Share on other sites

Use \n to denote new lines (in case you didn't know that).

So if you want, you could do something like...

function opsave() {
var agree=confirm("Are you sure you wish to save\n\n OK = yes\n Cancel = no?");
if (agree) {
"My Code"
}
}

I dunno. I've seen that before, but I think most people understand how to answer the question.

Perhaps VBS will allow you to use yes/no/cancel prompts. I dunno...

Edited by Dumpy Dooby
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...