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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:22:33+00:00 2026-06-17T15:22:33+00:00

Im working on a wordpress plugin. In the admin panel, I have a fieldset

  • 0

Im working on a wordpress plugin. In the admin panel, I have a fieldset and a checkbox. I would like to toggle the fieldset between disabled/enabled by checking/unchecking the checkbox.
Here is what I have so far, but it doesn’t seem to work.

HTML

<!-- This is the checkbox -->
<label>
    <input class="checkbox" type="checkbox" onchange="toggleDisable(this);" id="check"/> 
    enable
</label>

<!-- This is the field set -->
<fieldset id="field_set">
    <legend>Field-Set</legend>

    <label for="sel">selectBox</label>
    <select id="sel">
        <option value="posts">Posts</option>
        <option value="terms">Terms</option>
    </select>

    <label for="1">input</label>
    <input type="text" value="text" id="1" />

    <label for="2">input</label>
    <input type="text" value="text" id="2" />

</fieldset>

JavaScript

function toggleDisable(checkbox) {
    var toggle = document.getElementById("field_set");
    checkbox.checked ? toggle.disabled = false : toggle.disabled = true;
}

The event is not being fired, and nothing happens with the fieldset.
Oh, and here is a Fiddle.

  • 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-17T15:22:34+00:00Added an answer on June 17, 2026 at 3:22 pm

    Yout code is okay. The problem is in your fiddle. When you select onLoad and no No library it means that your javascript code will be placed inside window.onload closure:

    window.onload = function() { /* your code will go here */ }
    

    So in this case the function you define becomes a local scope function which is not available for the rest of the page. So to fix your problem you just need to select no wrap (head) for example. See this:

    http://jsfiddle.net/AY3Ka.

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

Sidebar

Related Questions

I'm working on a WordPress plugin. At the admin page, I have a ajax
I'm currently working on the admin section of a Wordpress plugin and I need
I'm working on a wordpress plugin, and have come across a barrier of sorts.
I'm working on a Wordpress plugin. I need to pass plugin directories (that can
I'm working with a WordPress plugin. It adds a flash player to the output
I am working on a wordpress plugin which allows user to enter name of
I'm working on a little wordpress plugin rate my whatever. This plugin works well
I'm a bit new to wordpress plugin coding. I've been working on a plugin
I developed a plugin with Settings link that was working fine in WordPress 2.7.
I am working with wordpress and I have to display a menu based on

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.