2

Sorry guys for asking that dumb question but I have problem with that thing. Have such script, it should return true or false, but after drawing that html pop-up window and getting response from that methods.

           $("#pageInfo a.btnDel").click(function () {

                    $("#cmsSmallPopUpWindowMessage").html("<h2>Do you really want to delete this page?</h2><center><div style='width:130px'><ul class='bactions'><li><a id='cmsSmallPopUpWindowBYes' href='javascript:void(0)'><span><span>Yes</span></span></a></li><li><a id='cmsSmallPopUpWindowBNo' href='javascript:void(0)'><span><span>No</span></span></a></li></ul><div class='archor'></div></div></center>");
                    $.blockUI({ message: $("#cmsSmallPopUpWindow"), css: { width: "530px", border: "0px", backgroundColor: "transparent"} });
                    setTimeout(function () {
                        $.unblockUI();
                    }, 6000);


                    $("#cmsSmallPopUpWindowBNo").click(function () {
                        $.unblockUI();
                        return false;
                    });


                    $("#cmsSmallPopUpWindowBYes").click(function () {
                        $.unblockUI();
                        location.reload();
                        return onDelete($(this).attr('href'));
                    });
                    return true; // this should change for "false" or "true" but after click on "yes" or "no" 


                });
2
  • 1
    What you're looking for is .confirm(). Take a look at this plugin: nadiana.com/jquery-confirm-plugin Commented Dec 14, 2012 at 13:28
  • Don't generate inline HTML inside js code, use templating better. Commented Jan 3, 2013 at 10:44

1 Answer 1

1

I would suggest to use the jQueryUI modal-confiramtion dialog. It just fits your needs, blocks the UI (modal), has a nice layout and works assync (not freezing the script).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.