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

  • Home
  • SEARCH
  • 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 946649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:57:12+00:00 2026-05-15T22:57:12+00:00

I have an issue which I hope someone can help me with. I’m able

  • 0

I have an issue which I hope someone can help me with. I’m able to retrieve the text value of my checkbox. What I want to achieve is every time I click on a checkbox, it adds the text to the input with an id of “Selected”. for example: if checkbox a, checkbox b, checkbox c are checked, I want to show “a, b, c”. Instead what I’m getting are the text of the current one that is checked. Any help would be great.

$(document).ready(function(){
    $("#ListBox input").click(function() {
            var cbText = $(this).next().text();

            $('#Selected').val(cbText);    
        });
});
  • 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-15T22:57:12+00:00Added an answer on May 15, 2026 at 10:57 pm

    It sounds like you want #Selected to have the text values for the currently selected checkboxes.

    If that’s right, try this: http://jsfiddle.net/nAACW/4/ (updated)

    $(document).ready(function(){
        $("#ListBox input").click(function() {
            var cbText = $('#ListBox').find(':checked').next()
                .map(function() {
                    return $.text([this]);
                }).get().join(', ');
    
            $('#Selected').val(cbText);    
        });
    });​
    

    EDIT: Changed to use $('#ListBox').find(':checked') instead of $(this).parent().find(':checked') as correctly suggested by @Felix Kling

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

Sidebar

Related Questions

I hope someone can help... This issue has been discussed here and I have
I hope someone may be able to help! We have a pretty large VB.Net
I certainly hope someone can help ease my frustration. I am trying to find
I have found an interesting issue in windows which allows me to cause the
I have the following application which replicates an issue I'm having in a larger
ok so my issue is i have the string '\222\222\223\225' which is stored as
I have a master page which all my views inherit from. The issue I
I have an issue that is driving me a bit nuts: Using a UserProfileManager
We have an issue using the PEAR libraries on Windows from PHP . Pear
We have an issue related to a Java application running under a (rather old)

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.