almulder Posted June 5, 2006 Posted June 5, 2006 (edited) 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 codealert(Do You want to save changes?);but it only make a "OK" buttonThank for your help. Edited June 5, 2006 by almulder
almulder Posted June 5, 2006 Author Posted June 5, 2006 Edited the question. Please reread. Thank You.
sadicq Posted June 5, 2006 Posted June 5, 2006 I'm at school so I don't have time to search it ... but take a look at this:http://www.w3schools.com/js/js_popup.asp
Dumpy Dooby Posted June 5, 2006 Posted June 5, 2006 (edited) replace alert with confirm. function opsave() { var agree=confirm("Are you sure you wish to save?"); if (agree) { "My Code" }} Edited June 5, 2006 by Dumpy Dooby
almulder Posted June 5, 2006 Author Posted June 5, 2006 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. LOLThank you.
Dumpy Dooby Posted June 6, 2006 Posted June 6, 2006 (edited) 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 June 6, 2006 by Dumpy Dooby
sadicq Posted June 6, 2006 Posted June 6, 2006 i can confirm that js doesn't allow you to do that. You can make a popup in html with 3 submit buttons.
almulder Posted June 6, 2006 Author Posted June 6, 2006 I will just use the "OK" and "Cancel" version for now then, But thank you.
Dumpy Dooby Posted June 6, 2006 Posted June 6, 2006 (edited) 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 June 6, 2006 by Dumpy Dooby
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now