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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T19:26:36+00:00 2026-05-20T19:26:36+00:00

EDIT/////// In addition to the helpful advice below, it turns out that another bug

  • 0

EDIT///////

In addition to the helpful advice below, it turns out that another bug was my inclusion of “[ ]” brackets inside my checkbox name attribute.

    <input type="checkbox" name="neighborhood_id[]"/>

That was screwing up my jquery selector, apparently.

//////END EDIT

I’ve gone through several related threads to find an answer to this and have come up empty. I’m positive it’s out there, but it’s so simple, it should a minute for someone to answer it.

I want to grab the values from multiple selected checkboxes (all with the same name attribute) and display them in a text input. Not sure if this is throwing a monkey wrench into it, but the checkboxes are initially hidden in a modal window. My attempt is working. I’ve also added .get() and toArray() to the map function, without success.

 $('[name=neighborhood_id[]]').change(function(){
    $('#area').val(function(){
        return $('[name=neighborhood_id[]]:checked').map(
            function(){return $(this).val()});
            });
    });

The problem that I’m having is that the text input is defaulting to the following:
[object Object] and it’s not updating when I do check the checboxes.

I’m assuming this might be related to returning the values from the each/map function as an array Object

thanks

  • 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-20T19:26:37+00:00Added an answer on May 20, 2026 at 7:26 pm

    You are definitely on the right track, just needed a few changes:

    $('input[name=neighborhood_id]').change(function() {
      $('#area').val(
          $('[name=neighborhood_id]:checked').map(function() {
              return $(this).val();
          }).get().join(',')
     );
    

    });

    I think your main problem was that you were sending an anonymous function to $('#area').val

    Working version: http://jsfiddle.net/uZcaT/

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

Sidebar

Related Questions

EDIT: It turns out that the second edit to my .emacs file actually works.
EDIT: See my answer below--> I am wanting to have a view that when
EDIT : It turned out that this can only be done through an external
EDIT: I was an idiot. I simply had an image that was vertically long,
EDIT: iam using ajax to load text in my content that is why onload
Edit : Note that, as Daniel and latkin noted in an answer and a
In addition to my question Creating an Edit my Item-page in Java Server Faces
I am following this tutorial: http://www.9lessons.info/2011/03/live-table-edit-with-jquery-and-ajax.html My addition is most content is ajax/json/dynamic. I
Edit : In addition to the bounty, we're willing to pay $250 to have
FURTHER EDIT: Given that individuals can only access the questionnaire from a seperate website,

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.