locked
Radiobutton autopostback is not working with jquery.min.js RRS feed

  • Question

  • User840052993 posted

    The autopostback of radio button used in a webpage is not working properly,it doesn't enter checked changed event because of a js im using  <script src="../../js/jquery.min.js"></script>

    Is there anything that i can do to make my radio button work. i cannot disable that js, because it is need in my site  

    Monday, August 3, 2015 6:43 AM

Answers

  • User1686483761 posted

    Hi, vjnithin

    The autopostback of radio button used in a webpage is not working properly,it doesn't enter checked changed event because of a js im using  <script src="../../js/jquery.min.js"></script>


    Are you sure that the problem is caused by the  js  script? 


    In order to solve this problem together, it's best to share you source code with us.

    and i have some suggestions : 


    1.if you only have a radio button, please make sure the autopostback  property is set to true  so that the radio button will enter checked changed event


    2.if you have multiple radio buttons, you can refer to http://forums.asp.net/t/1367815.aspx

    I hope it's helpful for you

    Best Regards
    cheng zhang

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, August 4, 2015 1:25 AM
  • User61956409 posted

    Hi vjnithin,

    The autopostback of radio button used in a webpage is not working properly,it doesn't enter checked changed event because of a js im using  <script src="../../js/jquery.min.js"></script>

    I’d like to know if you write some code to prevent from triggering OnCheckedChanged event. In the following sample, when you click the RadioButton, OnCheckedChanged event will not be triggered.

    <div>
        <asp:RadioButton ID="rdb" runat="server" AutoPostBack="true" OnCheckedChanged="rdb_CheckedChanged" />
        <br />
        <asp:Label ID="lblresult" runat="server" Text=""></asp:Label>
    </div>
    
    <script>
        $(function () {
            $("#rdb").click(function (event) {
                event.preventDefault();
            })
        })
    </script>
    
    protected void rdb_CheckedChanged(object sender, EventArgs e)
    {
        lblresult.Text = "it is checked";
    }
    

    Best Regards,

    Fei Han




    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, August 5, 2015 6:02 AM

All replies

  • User1686483761 posted

    Hi, vjnithin

    The autopostback of radio button used in a webpage is not working properly,it doesn't enter checked changed event because of a js im using  <script src="../../js/jquery.min.js"></script>


    Are you sure that the problem is caused by the  js  script? 


    In order to solve this problem together, it's best to share you source code with us.

    and i have some suggestions : 


    1.if you only have a radio button, please make sure the autopostback  property is set to true  so that the radio button will enter checked changed event


    2.if you have multiple radio buttons, you can refer to http://forums.asp.net/t/1367815.aspx

    I hope it's helpful for you

    Best Regards
    cheng zhang

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, August 4, 2015 1:25 AM
  • User61956409 posted

    Hi vjnithin,

    The autopostback of radio button used in a webpage is not working properly,it doesn't enter checked changed event because of a js im using  <script src="../../js/jquery.min.js"></script>

    I’d like to know if you write some code to prevent from triggering OnCheckedChanged event. In the following sample, when you click the RadioButton, OnCheckedChanged event will not be triggered.

    <div>
        <asp:RadioButton ID="rdb" runat="server" AutoPostBack="true" OnCheckedChanged="rdb_CheckedChanged" />
        <br />
        <asp:Label ID="lblresult" runat="server" Text=""></asp:Label>
    </div>
    
    <script>
        $(function () {
            $("#rdb").click(function (event) {
                event.preventDefault();
            })
        })
    </script>
    
    protected void rdb_CheckedChanged(object sender, EventArgs e)
    {
        lblresult.Text = "it is checked";
    }
    

    Best Regards,

    Fei Han




    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, August 5, 2015 6:02 AM