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 758839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:31:37+00:00 2026-05-14T15:31:37+00:00

I’m using jQuery UI Sortable to make a list categorizable. I’m stuck on the

  • 0

I’m using jQuery UI Sortable to make a list “categorizable”. I’m stuck on the code to put items in the proper category when the page is loaded with existing data (either from the database or just from a prior form submit).

The html is a list with radio buttons:

<ul id="Main" class="sort">
  <li>
    <input type="radio" name="i1" id="i1_M" value="M">
    <input type="radio" name="i1" id="i1_A" value="A">
    <input type="radio" name="i1" id="i1_B" value="B" checked>
    <input type="radio" name="i1" id="i1_C" value="C">
    This is the first item
  </li>
  <li>
    <input type="radio" name="i2" id="i2_M" value="M" checked>
    <input type="radio" name="i2" id="i2_A" value="A">
    <input type="radio" name="i2" id="i2_B" value="B">
    <input type="radio" name="i2" id="i2_C" value="C">
    This is the second item
  </li>
  [... etc. ...]
</ul>
<ul id="CatA" class="sort subC"></ul>
<ul id="CatB" class="sort subC"></ul>
<ul id="CatC" class="sort subC"></ul>

What I’d like is some code to run on page load to move the items where option A is checked into list CatA, those with option B checked to CatB, etc., leaving items with option M checked where they are. I haven’t the faintest idea where to start, even after wasting a day searching for solutions and reading tutorial after tutorial (all of which claimed to be aimed at Javascript beginners, leaving me rather depressed about my apparent lack of intellectual capacity, but I digress). Help?

(The page is asp-classic, jQuery is version 1.4.2, jQuery UI is version 1.8.)

  • 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-14T15:31:37+00:00Added an answer on May 14, 2026 at 3:31 pm

    Something like this? (Demo)

    $(document).ready(function(){
     $('#Main').find(':checked').each(function(){
      $(this).parent().appendTo( $('#Cat' + $(this).val() ));
     })
    })
    

    What it does is finds all checked radio button values, then moves the entire content into the categories. Since no #CatM is found, then it will silently fail and leave the M selected radio buttons in place.

    Note: The radio button values must all be a single letter and capitalized for this script to work properly (it must match the category IDs).

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

Sidebar

Ask A Question

Stats

  • Questions 476k
  • Answers 476k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The short answer is to use the setuid() function. It… May 16, 2026 at 4:45 am
  • Editorial Team
    Editorial Team added an answer You should be able to force the environment in the… May 16, 2026 at 4:45 am
  • Editorial Team
    Editorial Team added an answer Netbeans uses Ant tasks that are custom to the IDE… May 16, 2026 at 4:45 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.