Click here to Skip to main content
15,889,867 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello, i have a problem with jquery. I have a simple tab and accordions combo in jquery easy ui, tabs and accordion as a children div.

The data of accordion and tabs are read prom php arrays. I made a quick sneak peak of the html code below and fiddle

HTML
<div class="labels"><span></span> </div>
    <div id='easyui-tabs' style=" background: white;">
        <div id="tab1" title="1" style="padding:5px;">
            <div class="easyui-accordion">
                <div class="subgroup" title="1">
                   <p><input type="checkbox" value=""/><label></label></p>
                </div>
                <div class="subgroup" title="1">
                   <p><input type="checkbox" value=""/><label>^__b class="b_3">test3</label></p>
                </div>
            </div>
        </div>
        <div id="tab2" title="2" style="padding:5px;">
            <div class="easyui-accordion">
                <div class="subgroup" title="1">
                   <p><input type="checkbox" value=""/><label>^__b class="b_1">test1</label></p>
                </div>
                <div class="subgroup" title="1">
                   <p><input type="checkbox" value=""/><label>^__b class="b_2">test2</label></p>
                </div>
            </div>
        </div>
    </div>


JS
JavaScript
$(document).ready(function() {
            $('.easyui-accordion').accordion({
                animate: true,
                fit: true
            });
            $('#easyui-tabs').tabs({
                tabPosition: 'left',
                headerWidth: '80'
            });
        });

http://jsfiddle.net/msx20/cf5ju/19/

And i want to display the labels values by trigger checkbox for current label show/hide label values (dynamicly) in the "labels" div above separeted by comma.

The labels and inputs gonna have diferent classes.

I try to use click(function() and .val but i didnt work at all.

Can anyone help me with this simple thing please(i suppose ,for enyone who knows jquery)
Posted
Comments
Killzone DeathMan 6-Mar-14 11:33am    
Maybe I dont understand the question... If you click on the label, you want the check and uncheck the checkbox, right?
Just give the checkbox an id="something" and on the label add the attr for="something"...

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