Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3353658
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:10:41+00:00 2026-05-18T02:10:41+00:00

I am just starting out with JQuery and Javascript, and adapting a nested set

  • 0

I am just starting out with JQuery and Javascript, and adapting a nested set of checkbox inputs to make use of jstree checkbox behaviours. After realising that each item had to be an anchor tag to be recognised by the jstree code, I am now unsure how to generate values from the items for a POST form submission. Previously they were checkbox inputs, and I would like to be able to keep them this way so that the form would still function if Javascript were turned off. wrapping inputs in the anchor tag resulted in two checkboxes for each item, one styled and behaviourally controlled by JStree, the other ignored. I assume this isn’t the direction to go.

Any advice on how to achieve this would be gratefully received.

I am booting JStree with the following config code –

$(document).ready(function()
{
    $('.nested-category').jstree({ 
        ui: { theme_name : "checkbox" },
        plugins : ["checkbox", "themes", "html_data", "ui" ]
    });
}
);

Here is a simplified version of the form which the JStree code effects, but which can’t submit values.

<form method="post" action="">

<div class="nested-category">

<ul class="">
    <li><a href="#">group1</a>
        <ul>
            <li><a href="#">subgroup1</a>
                <ul>
                    <li><a href="#">item1</a></li>
                    <li><a href="#">item2</a></li>
                    <li><a href="#">item3</a></li>
                </ul>
            </li>
            <li><a href="#">subgroup2</a>
                <ul>
                    <li><a href="#">item4</a></li>
                    <li><a href="#">item5</a></li>
                    <li><a href="#">item6</a></li>
                </ul>
            </li>
        </ul>
    </li>
    <li><a href="#">group2</a>
        <ul>
            <li><a href="#">subgroup3</a>
                <ul>
                    <li><a href="#">item7</a></li>
                    <li><a href="#">item8</a></li>
                    <li><a href="#">item9</a></li>
                </ul>
            </li>
            <li><a href="#">subgroup4</a>
                <ul>
                    <li><a href="#">item10</a></li>
                    <li><a href="#">item11</a></li>
                    <li><a href="#">item12</a></li>
                </ul>
            </li>
        </ul>
    </li>
</ul>
</div>

<input class="form-submit" type="submit" name="submit" value="submit">
</form>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T02:10:41+00:00Added an answer on May 18, 2026 at 2:10 am

    I solved the issue by adding input elements inside each anchor tag, which are hidden by a bit of additional Javascript. A couple of additional lines in the jsTree script add ‘checked’ to the inputs when the jsTree generated input is checked, and vice versa if the input is returned to the form checked. If Javascript is switched off, the input checkboxes work as normal in an HTML form.I can post examples and the changes made to jsTree if anyone would like further explanation.

    I don’t doubt this is a bit of a ramshackled way to solve the problem, but that’s where I’m at in my currently unenlightened state of web development!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just starting out in asp.net. Have just created a login.aspx page in my site
I am just starting out with DI & unit testing and have hit a
I am just starting out with Silverlight (2 RC0) and can’t seem to get
So I am just starting out developing PHP web applications and have finished setting
I'm just starting out playing around with Linq Expressions and I've hit a wall.
I'm just starting out with the whole ajax thing and I need some help.
I'm just starting out writing trying to write a simple program in C and
I'm just starting out with WiX as I need to be able to automate
I'm just starting out with F# and I can't find the syntax to do
I'm just starting out using Ruby and I've written a bit of code to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.