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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:48:19+00:00 2026-06-03T09:48:19+00:00

I have a dynamically generated list, of random length from zero items up, where

  • 0

I have a dynamically generated list, of random length from zero items up, where each item includes by a checkbox. Unlike radio buttons, all of the checkboxes can be unchecked, but like radio buttons only one can be checked. To enforce this, I am using JQuery (based on the answer given here: jQuery – checkboxes like radiobuttons)

My code as it currently stands is:

var $radiocheck = $('input.radiocheck');
$radiocheck.click(function() {
    if($(this).is(':checked')) {
        $(this).attr('checked', false);
    }
    else if($(this).not(':checked')) {
        $radiocheck.removeAttr('checked');
        $(this).attr('checked', true);
    }
});

…but it doesn’t work (checkboxes remain unchecked on click). Any help is appreciated!

  • 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-03T09:48:21+00:00Added an answer on June 3, 2026 at 9:48 am
    var $radiocheck = $('input.radiocheck');
    
    $radiocheck.on('click', function() {
        $radiocheck.not(this).prop('checked', false);
        this.checked = this.checked===true ? true:false; // to toggle, otherwise just set to true
    });​
    

    FIDDLE

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

Sidebar

Related Questions

I have a dynamically generated list of URL's from our internal network. For each
On my page, I have a dynamically generated list of radio buttons (created with
I have dynamically generated a list of wine types from the database using AJAx
I have an issue concerning constraints which should be generated dynamically from a list
I have multiple sortable lists that are dynamically generated from a list in MySQL.
I have a drop down list which is dynamically generated using ajax on page
I have a set of radio buttons that are dynamically generated (via JSON call):
I have a listbox whose values are generated dynamically. The list box contains months
For my palm pre app I have a dynamically generated list (pulling in data
I have a dynamically generated list of students. I want the users to capture

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.