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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:18:17+00:00 2026-05-22T17:18:17+00:00

I added a disable/enable feature but the select menus are always disabled. I would

  • 0

I added a disable/enable feature but the select menus are always disabled. I would like to enable them based on whether or not a user clicks a check box. User reply check box enables #usernames and text effects check box enables #boxcode, #colors.

Also I have a clear function I want to use to remove the values from #display, #message, #names, #boxcode but it doesn’t do anything when the button is clicked.

Jquery

function userreply() {
    $('#display').text('startreply ' + 'middlereply ' + $('#usernames').val() + ' endreply ' + $('#message').val());
    $("input:checkbox").click(function() {
        $("#usernames").attr("disabled", !this.checked);
    });
}

function texteffect() {
    $('#display').text('starttag '
    $('#message').val() + ' endtag ' + $('#boxcode').val());
    $("input:checkbox").click(function() {
        $("#boxcode, #colors").attr("disabled", !this.checked);
    });
}

function clear() {
    $('#display, #message, #names, #boxcode').reset();
}

$('#message').keyup(userreply);
$('#usernames').change(userreply);
$('#boxcode').change(texteffect);

HTML

<form>
    <input type="checkbox" name="enableuserreply" onclick="enable_text(this.checked)" /> Enable User Reply<br />
    <input type="checkbox" name="enapletexteffect" onclick="enable_text(this.checked)" /> Enable Text Effect<br />
    <select id="usernames" disabled="disabled">
        <option value="">Users</option>
        <option value="Alex">Alex</option>
        <option value="Jeff">Jeff</option>
        <option value="Amy">Amy</option>
        <option value="Kate">Kate</option>
    </select>
    <select id="boxcode" disabled="disabled">
        <option value="">Codes</option>
        <option value="[b][/b]">Bold</option>
        <option value="[i][/i]">Italics</option>
        <option value="[u][/u]">underline </option>
        <option value="[s][/s]">Strike</option>
        <option value="[sup][/sup]">Super Script</option>
        <option value="[sub][/sub]">Sub Script</option>
        <option value="[center][/center]">Center</option>
        <option value="[big][/big]">Big</option>
        <option value="[small][/small]">Small</option>
        <option value="[br]">Line Break</option>
        <option value="[url=][/url]">Link</option>
        <option value="startpicture endpicture">Picture</option>
        <option value="[color=][/color]">Color</option>
    </select>
    <select id="colors" disabled="disabled">
        <option value="">Color</option>
        <option value="red">red</option>
        <option value="blue">blue</option>
        <option value="green">green</option>
        <option value="white">white</option>
    </select>
    <input id="message" type="text" />
    <input type="button" value="Clear" onclick="clear()" />
</form>

<pre id="display"></pre>
  • 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-22T17:18:17+00:00Added an answer on May 22, 2026 at 5:18 pm

    As for your enable disable problem have a look at this JsFiddle.

    I changed checkboxes names to ids and completely rewrote the click handlers to work with jQuery 1.6.

    BTW there were quite many syntax errors in your code 🙂

    Have fun

    K

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

Sidebar

Related Questions

I would like to enable/disable some code based on a custom solution configuration I
I failed to find a way to disable the browser detection feature added by
I added the columns in the select list to the order by list, but
This code does not disable my element as expected if(Multifile.n==0){ $(#btnUpload).attr(disabled,disabled); } This code
I have a Chrome Extension I'm trying to add features with an enable/disable option.
I have C++ code. That code contains Windows mobile GPS enable/disable functionality. I want
I am simply attempting to use a checkbox to enable/disable an NSTextField. I have
This is a somewhat subjective question, but I'd like to hear the pros/cons for
I have a button like the following, <asp:Button ID=pagerLeftButton runat=server OnClientClick=disable(this) onclick=pager_Left_Click Text=< />
I have a few jquery thinngs added to my site like gallery, callendar, autocomplete

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.