Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am trying display confirm dialog box after submit and do the rest of the process i am using following code but i click confirm nothing is happening.

button :

<asp:linkbutton id="btnSubmit" runat="server" validationgroup="grpContact" cssclass="greyBtn" OnClick="btnSubmit_Click"> Submit</asp:linkbutton>

Jquery:

$(document).ready(function () {
        $("#<%=btnSubmit.ClientID %>").click(function () {
            var validated = Page_ClientValidate('grpContact');
            if (validated) {
                $("#dialog").dialog({
                    buttons: {

                        "Confirm": function () {

                            $("#<%=btnSubmit.ClientID %>").submit();
                            $(this).dialog("close");
                            return true;

                        },
                        "Cancel": function () {
                            $(this).dialog("close");
                            return false;
                        }

                    }
                });
            } return false;
        });
share|improve this question

1 Answer 1

Try using preventDefault()
Here's an example:

$(document).ready(function () {
            $("#<%=btnSubmit.ClientID %>").on("click", function(e) {
            e.preventDefault();
            var validated = Page_ClientValidate('grpContact');
            if (validated) {
                $("#dialog").dialog({
                    buttons: {

                        "Confirm": function () {

                            $("#<%=btnSubmit.ClientID %>").submit();
                            $(this).dialog("close");
                            return true;

                        },
                        "Cancel": function () {
                            $(this).dialog("close");
                            return false;
                        }

                    }
                });
            } return false;
        });
share|improve this answer
1  
what should be in confirm button –  raky Jan 16 '13 at 0:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.