We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible for the tree to use checkboxes to allow for the tree values to be submitted in a form?
The text was updated successfully, but these errors were encountered:
you could easily do that using the onChange method of the tree itself:
html:
<form ...> <input id="selectednodesformfield" type="hidden" name="selectednodes" /> </form>
js:
let selectedNodes = []; let tree = new Tree('<selector>', { ..., onChange: function() { selectedNodes = []; this.selectedNodes.forEach( function(node){ selectedTree.push(node.id); }); document.getElementById('#selectednodesformfield').value = JSON.stringify(selectedNodes); }, ... });
Now you have an JSON encoded string of all node Ids in a formfield and you can work with that at the target of your form submission.
Sorry, something went wrong.
No branches or pull requests
Is it possible for the tree to use checkboxes to allow for the tree values to be submitted in a form?
The text was updated successfully, but these errors were encountered: