You must Sign In to post a response.
  • Category: JQuery

    Jquery button click event not firing

    Hi All,

    I was trying to validate form using jquery but button click event not firing in IE .

    Could you please help me to resolve on this issue.

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js" type="text/javascript"></script>

    <script type="text/javascript">
    $(document).ready(function () {
    $("#btnResubmit2").click(function () {
    alert('btnResubmit2 Here');
    });
    });
    </script>

    HTML code
    <asp:Button ID="btnResubmit2" runat="server" Text="Resubmit" onclick="btnResubmit2_Click"/>
  • #762936
    Hi Rajan.

    I this you should use the earlier version of the jquery reference as you are making use of google CDN.

    You have used
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js" type="text/javascript"></script>

    Keep this as reference of jquery from google CDN.
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>

    This will work for IE7 and IE8 also.

    Sridhar Thota.
    Editor: DNS Forum.

  • #762942
    Hai Rajan,
    You can use the below code :

    <!DOCTYPE html>
    <html>
    <head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    <script>
    $(document).ready(function () {
    $("#btnResubmit2").click(function () {
    alert('btnResubmit2 Here');
    });
    });
    </script>
    </head>
    <body>
    <button id="btnResubmit2">Resubmit</button>
    </body>
    </html>

    Hope it will be helpful to you.

    Regards,
    Pawan Awasthi(DNS MVM)
    +91 8123489140 (whatsApp), +60 14365 1476(Malaysia)
    pawansoftit@gmail.com

  • #762948
    Hello Rajab B,

    Refer the below code :

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
    <title></title>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script type="text/javascript">
    $(document).ready(function() {
    $("#<%=btnResubmit2.ClientID %>").click(function() {
    alert('btnResubmit2 Here');
    });
    });
    </script>
    </head>
    <body>
    <form id="form1" runat="server">
    <div>
    <asp:Button ID="btnResubmit2" runat="server" Text="Resubmit" />
    </div>
    </form>
    </body>
    </html>

    See the attached image. It's an output i have got using above mentioned code.


    Hello Pawan,

    They way you have shown is right but it will work on HTML button and it will not work on ASP.NET Button for that he must use <%=btnResubmit2.ClientID %>


    Hope it will help you.

    Regards,
    Nirav Lalan
    DNS Gold Member
    "If you can dream it, you can do it."

    Delete Attachment

  • #762956
    Thanks to all. I was using Asp.net button and it was worked after done some changes like as below. I really appreciate your immediate reply.

    $(document).ready(function () {
    $('#<%= Button1.ClientID %>').click(function () {
    alert('btnResubmit2 Here');
    });
    });


  • Sign In to post your comments