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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:51:46+00:00 2026-06-12T12:51:46+00:00

I am trying to modify an form using JavaScript to populate the options for

  • 0

I am trying to modify an form using JavaScript to populate the options for this form. I am almost done with but I hit a milestone that I cannot overcome. I am wondering if someone can help. The sample is available form here: http://jsfiddle.net/vladc77/bq5U6/3/

I can assign closed days successfully (Saturday & Sunday), but I cannot change the status (disabling/enabling) of the all working days by checking/unchecking check boxes in the form. Please let me know what can be done without changing the way I assign styles to the check boxes in this line:

 $(this).append(' <span class="closed custom-checkbox"><input type="checkbox" name="closed" value="closed" class="closed" id="closedHoursElement" onchange="closedHours()"><span class="box"><span class="tick"></span></span></span>Closed');

Thank you in advance.

  • 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-12T12:51:48+00:00Added an answer on June 12, 2026 at 12:51 pm

    it’s because you are trying to get siblings of the checkbox.. which it’s only sibling is a span element. The select elements are siblings of the parent element.

    $('input[type=checkbox]').change(function() {   
           $(this).parent().siblings('select').prop('disabled', this.checked);
    });
    

    http://jsfiddle.net/vladc77/bq5U6/3/

    You should also be using .prop() to set disabled attribute. for jQuery 1.6+

    From jQuery docs

    The .prop() method should be used to set disabled and checked instead of the .attr() method.

    Using prop to set the disabled property you can just set it to true or false

    $(element).prop('disabled',true);  // disabled
    $(element).prop('disabled',false); // not disabled
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to modify an svg tag with javascript to make it resizable, but
I am trying to implement a JavaScript function that will modify the result values
I am trying to modify the fields on my Wordpress comment form using the
I'm trying to make a custom search form using django haystack, i just modify
I have run into a problem trying to modify a form I myself have
Hello i was trying to modify an object form the values of another object
I'm trying to modify a Django form to use a textarea instead of a
I am trying to modify the android lvl library and as part of this
I am trying to modify the script below to click a button that looks
I have a form that I am using to post data to mysql. Before

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.