Check item present or not.

2 posts, 1 answers
  1. JC
    JC avatar
    30 posts
    Member since:
    Feb 2013

    Posted 15 Mar 2013 Link to this post

    Hi All,
    How to check if the tagcloud contains a certain item using javascript?

    Thanks,
    JC.
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 15 Mar 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top