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

The Archive Base Latest Questions

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

I am still pretty new to jQuery, so forgive me if this doesn’t make

  • 0

I am still pretty new to jQuery, so forgive me if this doesn’t make sense the first round.

I have a set of checkboxes (allowed, not allowed, negotiable), that if you check allowed or negotiable it unhides another set of checkboxes via the onclick event.

The problem I am having is that when the page is refreshed, I want the second set of checkboxes to be visible if allowed or negotiable are checked. I’d like this to be done on page load, not through any click or change events if possible.

I have tried various suggestions to other issues with no luck.
eg: if ($("#id_pets_0").attr("checked")==true)

Is this possible?

If anyone has any alternatives to this, I’m game for that as well.

UPDATE:
This is what I have been attempting.

$(function() {
   if ($("#id_pets_0").attr("checked")==true) {
        $("#dogs").show();
        $("#cats").show();
    }
    else {
        $("#dogs").hide();
        $("#cats").hide();
    }
});

UPDATE:
This code does work. So I know that it is checking the checkboxes for the click events at least.

$(function() {
    $('input#id_pets_0').click(function() {
    if ($(this).attr("checked")) {
        $("#id_pets_1").attr("checked", false);
        $("#dogs").show("slow");
        $("#cats").show("slow");
        return;
    }
    if ($("#id_pets_2").attr("checked")) {
        $("#dogs").show("slow");
        $("#cats").show("slow");
    }
    else {
        $("#id_dogs_0").attr("checked", false);
        $("#id_dogs_2").attr("checked", false);
        $("#id_cats_0").attr("checked", false);
        $("#id_cats_2").attr("checked", false);
        $("#dogs").hide("slow");
        $("#cats").hide("slow");
    }
});
});
  • 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-20T18:15:12+00:00Added an answer on May 20, 2026 at 6:15 pm

    Thanks to all that answered. I would have thought those would have worked.

    What I ended up doing was wrapping the show/hide options in a Django template if and use the context that was being passed. Since I was capturing the selection of pets I was able to then use the if to show or hide the cats and dogs selection section.

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

Sidebar

Related Questions

I am still pretty new to using jQuery to do anything, but I have
I am still pretty new to this and I am working on my first
I'm still pretty new to asp.net web forms. I have a requirement to make
This is my first play 2.0 app, and scala is still pretty new to
Im still pretty new so bear with me on this one, my question(s) are
I am still pretty new to PHP so forgive me if I am overlooking
Question ONE: I'm still pretty new to .net, but have used Visual Studio for
Okay this is my 4th question today on Scheme, still pretty new to Scheme,
still pretty new to android I have to clone an iphone application. Im having
I'm still pretty new to Objective-C coding (as evidenced by this question) and I

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.