get checked values for jsTree - submit with form post

前端 未结 11 1663
南笙
南笙 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:08

    $(document).ready(function(){
    var jsfields = $('#myTree').jstree('get_selected');
    $('.jsfields').val(JSON.stringify([jsfields]));
    })
    
    
    

    Change the value of $('#myTree') to you respective tree, this is best working for me in ajax call. slight modification may be needed to populate input field of simple form.

提交回复
热议问题