Return text value of checked button

2 posts, 0 answers
  1. Brian
    Brian avatar
    21 posts
    Member since:
    Jul 2013

    Posted 10 Jan 2014 Link to this post

    I have a toolbar that is dynamically created server side.  Client side, I'm trying to determine which button is currently clicked and capturing the text value of the button.  One of the buttons is definitely checked but I never return a value.  What am I doing wrong?

    function RowDblClick(sender, eventArgs) {
                    var toolBar = $find("<%=radtoolMonths.ClientID%>");
                    var intMonths = toolBar.get_items().get_count();
                    var datMonth='1/1/14'
                    for (var i = 0; i < intMonths; i++)
                    {
                        if (toolBar.get_items().getItem(i).get_checked == true) {
                            datMonth = toolBar.get_items().getItem(i).get_text;
                        }
                    }

  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 12 Jan 2014 Link to this post

    Hi,

    Please try the following JavaScript to get the text of Checked Button of RadToolBar.

    JavaScript:
    <script type="text/javascript">
        function pageLoad() {
            var toolBar = $find("<%=radtoolMonths.ClientID%>");
            var intMonths = toolBar.get_items().get_count();
            for (var i = 0; i < intMonths; i++) {
                if (toolBar.get_items().getItem(i).get_checked() == true)
                    alert(toolBar.get_items().getItem(i).get_text());
            }
        }
    </script>

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top