get checked values for jsTree - submit with form post

前端 未结 11 1672
南笙
南笙 2020-12-14 02:40

I\'m using the jsTree jQuery plugin with the checkbox theme. Does anyone know how to get the selected values with a form post?

Thank you!

11条回答
  •  一向
    一向 (楼主)
    2020-12-14 03:00

    With jQuery you can simply do:

    $('.jstree-checked,.jstree-undetermined').each(function(){
        var rawCheckedID = $(this).find('a').attr('id');
    });
    

    This will get the undetermined and checked at the same time. soumya's solution above may be more efficient.

提交回复
热议问题