mardi 18 octobre 2016

How to call function inside javascript

<script type="text/javascript>
function submitMe() {
        var checked_ids = [];
        $('#your-tree-id').jstree('get_checked',null,true).each(function(){
                checked_ids.push(this.id);
        });
        //setting to hidden field
        document.getElementById('jsfields').value = checked_ids.join(",");
}
</script>
<input type="hidden" name="jsfields" id="jsfields" value="" />

I'm searching the way to get checked Ids of Jstree in form submit. So this is what I get. However, how I can call this function in my program?

Thanks if anyone could help me!!




Aucun commentaire:

Enregistrer un commentaire