This is a migrated thread and some comments may be shown as answers.

Return text value of checked button

1 Answer 37 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 2
Brian asked on 10 Jan 2014, 08:26 PM
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;
                    }
                }

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 13 Jan 2014, 05:58 AM
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.
Tags
ToolBar
Asked by
Brian
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Share this question
or