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

Check item present or not.

1 Answer 9 Views
TagCloud
This is a migrated thread and some comments may be shown as answers.
JC
Top achievements
Rank 1
JC asked on 15 Mar 2013, 08:42 AM
Hi All,
How to check if the tagcloud contains a certain item using javascript?

Thanks,
JC.

1 Answer, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 1
answered on 15 Mar 2013, 09:20 AM
Hi,

Please have a look into the following JavaScript to check whether an item is present in the RadTagCloud.

JavaScript:
<script type="text/javascript">
    function checkItem() {
        var theTagCloud = $find("<%=RadTagCloud1.ClientID%>");
        var checkItemText = $get("<%=Textbox1.ClientID %>").value;
        var items = theTagCloud.get_items();
        for (var i = 0; i < items.length; i++) {
            if (items[i].get_text() == checkItemText) {
                radalert("The item already exists!");
            }
        }
    }
</script>

Thanks,
Princy.
Tags
TagCloud
Asked by
JC
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Share this question
or