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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:48:53+00:00 2026-05-24T22:48:53+00:00

I want to have 3 checkboxes, lets call them checkbox1, checkbox2, and checkbox3. <form

  • 0

I want to have 3 checkboxes, lets call them checkbox1, checkbox2, and checkbox3.

<form id="test">
<div id="startingpoint"> 
<div id="clickdiv"><input type="checkbox" id="checkbox1" value="1" />checkbox1</div>
<div id="clickdiv"><input type="checkbox" id="checkbox2" value="1" />checkbox2</div>
<div id="clickdiv"><input type="checkbox" id="checkbox3" value="1" />checkbox3</div>
</div>
<div id="endingpoint"></div>
</form>

I set them up so that when a checkbox is checked, it uses appendTo to relocate them from “starting point” to “ending point”. It is working fine. Problem is, I want them to stay in chronological order (the order they started in).

SO…if I checked “checkbox3” and then “checkbox1”, I want the result to be this:

<form id="test">
<div id="startingpoint"> 
<div id="clickdiv"><input type="checkbox" id="checkbox2" value="1" />checkbox2</div>
</div>
<div id="endingpoint">
<div id="clickdiv"><input type="checkbox" id="checkbox1" value="1" />checkbox1</div>
<div id="clickdiv"><input type="checkbox" id="checkbox3" value="1" />checkbox3</div>
</div>
</form>

BUT…with the way appendTo works, I get this (note that “checkbox3” is above “checkbox1”)

<form id="test">
<div id="startingpoint"> 
<div id="clickdiv"><input type="checkbox" id="checkbox2" value="1" />checkbox2</div>
</div>
<div id="endingpoint">
<div id="clickdiv"><input type="checkbox" id="checkbox3" value="1" />checkbox3</div>
<div id="clickdiv"><input type="checkbox" id="checkbox1" value="1" />checkbox1</div>
</div>
</form>

How can I keep them in chronological order, specifically the order that they started in. Perhaps appendTo isn’t the solution?

ADDED IN RESPONSE TO COMMENT:

<script type="text/javascript">
$(function(){
$('#test input').attr('checked', false);
$('#test input').click(function(){
    if (this.checked) {
        $(this).closest('div').hide().appendTo("#endingpoint").fadeIn(1000)
    }
    else {
        $(this).closest('div').hide().appendTo("#startingpoint").fadeIn(1000)
    }
});
});
</script>
  • 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-24T22:48:54+00:00Added an answer on May 24, 2026 at 10:48 pm

    A simple solution would be to have three empty divs as children of endpoint, use IDs or another attribute to identify them. When a checkbox is selected, the html of the corresponding div in endpoint is set to the checkbox html.


    Update (Response to comment):

    You can setup your code so that it is irrelevant how many checkboxes there are. You can get the index of an object by setting an attribute ‘order’ for example then call this.attr(‘order’) to get the order value and append to $(‘#clickDiv’ + order). You can also use the ID attribute and simple string manipulation to the same effect.

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

Sidebar

Related Questions

Ok lets say I have div with form elements inside of it. I want
I want to submit a form that have many checkboxes with different values, using
i'm want to have a repeater generate a bunch of checkboxes, e.g.: <tr><td><input type=checkbox
i have a form with some checkboxes on it i want to save those
I am working on zend. I have a form with some checkboxes. I want
I have two CheckBoxes and a TextBox. I want to TextBox to have IsEnabled=False
I have 11 different checkboxes in my JFrame and want to be able to
I have a set of checkboxes and have disabled few which I want to
I have a group of checkboxes that I only want to allow a set
I have created a gridview with a column of checkboxes. I want the user

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.