get checked values for jsTree - submit with form post

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

    i did this to get id,parentid and text of selected checkbox. hopefully it will help someone :)

    function myFunction(elmnt,clr){
             elmnt.style.color =clr;
             var selectedElmsinfo = [];
    
             var selectedElms = $('#SimpleJSTree').jstree("get_selected", true);
                $.each(selectedElms, function() {
                    selectedElmsinfo.push(this.id,this.text,this.parent);
    
                });
                 alert(selectedElmsinfo);
            }
    

提交回复
热议问题