Click here to Skip to main content
15,888,242 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi, I have many tab panels being created dynamically in tab container based on what the user has selected from a listbox. If user has selected 'item1' and 'item2' from listbox, 2 tab panels will be created with tab ID and header text as 'item1' and 'item2'.

I would like to add in chart with chartID 'chart1' into tab panel 'item1' and 'chart2' into tab panel 'item2'. I want to use javascript to check if tab panel 'item1' and 'item2' exist, can check by tab id or tab headertext. It is something like if tab panel 'item1' exist, add 'chart1', then if 'item2' exist, add 'chart2', if 'item3' exist, add 'chart3', and so on..

This is my codes currently, but is not working..
C#
$(function () {
    $("#RETRIEVE_BUTTON").click(function () {
        var str = "Item 1";

        if (str != "") {
            $("panel").each(function () {
                var title = $(this).text();
                if (str == title) {
                    alert("existing");
                }
            })
        }
    })
})


Appreciate if someone could provide me help on this. Thanks!
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900