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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:40:15+00:00 2026-05-28T05:40:15+00:00

I have a set of Checkboxes on a page which I am getting hold

  • 0

I have a set of Checkboxes on a page which I am getting hold of using JQuery, on a user clicking the checkbox I need the value to be sent to a field which will be hidden and I need each value added to be delimited by a | I have written the following.

        $(document).ready(function() {
        $('input[name="_CKBXprod_link"]').attr("id", "_CKBXprod_link");
           $('input[name="_CKBXprod_link"]').click(function() {
               $('#link_ids').val(this.value+"|");
           });
        });

Simple! 😉 can anyone tell me what I am missing it is adding values but they are replace by each click of a checkbox.

  • 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-28T05:40:15+00:00Added an answer on May 28, 2026 at 5:40 am

    Description

    I think what you really want is a input box that holds all your checked
    checkboxes uniquely.

    Sample

    <input type="text" id="link_ids"/>
    
    <input type="checkbox" class="_CKBXprod_link" value="1"/>
    <input type="checkbox" class="_CKBXprod_link" value="2"/>
    <input type="checkbox" class="_CKBXprod_link" value="3"/>
    <input type="checkbox" class="_CKBXprod_link" value="4"/>
    
    $(document).ready(function() {  
        $('._CKBXprod_link').click(function() {
            var checkboxes = $("._CKBXprod_link:checked");
            var values = "";
            checkboxes .each(function() {
               values += $(this).val() + "|";
            });
    
            $(link_ids).val(values.substring(0, values.length-1));
        });
    });
    

    Check out this jsFiddle

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

Sidebar

Related Questions

I have a set of checkboxes: <input name=LocType type=checkbox value=Hospital/>HOSPITALS&#160;&#160; <input name=LocType type=checkbox value=Office/>
I have a Jquery Mobile shell page, which I'm loading a form into using
I have a set of checkboxes and have disabled few which I want to
I have outline view each element of which is checkbox. I want to set
I have a form which contains a checkbox field. On page load I want
In our SharePoint project, we have a page layout in which the user can
I have set up a workspace area which represents a blank PDF page where
I am using spring security and have an admin jsp page for editing user
I have the following code set up for a list of checkboxes in jQuery
I have a set of checkboxes that an Admin can tick to give users

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.