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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:55:06+00:00 2026-06-09T19:55:06+00:00

I have a checkbox group generated dynamically and I need to bind it to

  • 0

I have a checkbox group generated dynamically and I need to bind it to my knockout viewmodel.

Here is my code for the checkbox group:

<p>
    <label>Properties</label>
    <span class="formwrapper">
        @{
            foreach (ComboProperty item in this.Model.Properties)
            { 
                @:<input type="checkbox" name="chkproperty" value="@item.PropertyId" /> @item.Name<br/>

                }
        }
    </span>
</p>

So here instead of a Radio Button group I can have multiple checkboxes selected. So first need to know how to create my knockout viewmodel in order to manage multiple values and then how to bind it.

I have created this in fiddler for reference. It has the json collection.

http://jsfiddle.net/SSHev/5/

Thanks a lot.

  • 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-06-09T19:55:07+00:00Added an answer on June 9, 2026 at 7:55 pm

    I am not sure what you are trying to accomplish but I’ve updated your jsFiddle in order to make it work:

    http://jsfiddle.net/SSHev/11/

    When you have a multiple checkboxes that are related, you have a multiple choice input. In Knockout, such an input can be mapped to an array of values. As you see in my updated fiddle, checking and unchecking the boxes will insert or remove the appropriate value from the self.properties variable. This variable is an observable array.

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

Sidebar

Related Questions

I have the following two checkbox groups: <fieldset class=CbxGroup> <legend>Checkbox Group (required)</legend> <label><input type=checkbox
I have a checkbox group in one form that I need to be posted.
I have drawn a checkbox in devexpress grid group row using the code below.
i have checkbox list printed in one column, but i need it to print
I have 4 checkboxes on a winform I need to group them in such
I have some JavaScript/jQuery code that watches for the changed event on a checkbox:
I have a group of radio buttons with a class of laser2 on each
I want to have a group of radiobuttons that are inactive until a checkbox
I have a group of checkboxes, one of them has a label of 'None'.
I have a group of check boxes with same name, what I need is

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.