• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 207
  • Last Modified:

Popup Message in ASP page, if click okay, update access db.

Hey guys,
I don't know if it is possible or not, but I was hoping to have a user click on a link and a popup message appears, giving them the options "Yes" or "Cancel".  If they click "Yes", then I can update my access db via sql.  I don't care if clicking yes causes the page to redirect to a page that will run the sql code.

Hopefully this makes sense!

1 Solution
Well, in "plain" javascript, you can only get OK, Cancel:

<a href="thePagetoGo.html" onclick="return confirm('Are you sure you want to continue?') ";>Save</a>
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
you would need a custom dialog box, the easiest solution would be to use jQuery:

            function showDialog( title, msg ) {
                $("<div>" + msg + "</div>").dialog({
                    buttons: { "Yes": function() { submitForm() } },
                    close: function(ev, ui) { $(this).remove(); },
                    hide: "drop",
                    modal: true,
                    title: title,
                    overlay: { backgroundColor: "#000", opacity: 0.5 }

            function submitForm() {
                 // code to submit form to server to save to db, either by normal submit functionality or via ajax

the above code is just a basic function I sometime use for quick modal dialog boxes. Here are 2 links, one with info on modal dialogs and another that explains ajax:


Hope this helps!
Slim81Author Commented:
Thanks!  Super easy and answered my question.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now