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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:20:20+00:00 2026-05-14T04:20:20+00:00

I have a drop down box and some text input fields below it. Based

  • 0

I have a drop down box and some text input fields below it. Based on which item from the drop down menu the user selects, I would like to disable some of the fields. I think I am failing to target the input fields correctly but I can’t figure out what the problem is:

Here is the script I have gotten so far:

$(document).ready(function(){
var customfield = $('#customfields-tf-19-tf');
var customfield1 = $('#customfields-tf-20-tf');
var customfield2 = $('#customfields-tf-13-tf');


$(function() {
  var call_table = {
    'Condominium': function() {
     customfield.attr("disabled");     
     },
    'Co-Op': function() {
     customfield1.attr("disabled");
     },
    'Condop': function() {
     customfield2.attr("disabled");
     }
  };

  $('#customfields-s-18-s').change(function() {
    call_table[this.value]();
  });

});

});

And the layout for my form:

<td width="260" class="left">
<label for="customfields-s-18-s">Ownership (Required):</label>
</td>
<td class="right">
<select name="customfields-s-18-s" class="dropdown" id="customfields-s-18-s" size="" >
<option value="Condominium"> Condominium</option>
<option value="Co-Op"> Co-Op</option>
<option value="Condop"> Condop</option>
</select>
</td>
</tr> 



<tr>
<td width="260" class="left">


  <label for="customfields-tf-19-tf">Maintenance:</label>
</td>
<td class="right">
  <input type="text" title="Maintenance" class="textInput" name="customfields-tf-19-tf" id="customfields-tf-19-tf"  size="40"/>
</td>

</tr>


<tr id="newsletter_topics">
<td width="260" class="left">

  <label for="customfields-tf-20-tf">Taxes:</label>
</td>
<td class="right">
  <input type="text" title="Taxes" class="textInput" name="customfields-tf-20-tf" id="customfields-tf-20-tf"  size="40" />
</td>
</tr>


<tr>
<td width="260" class="left">

  <label for="customfields-tf-13-tf" class="required">Tax Deductibility:</label>
  </td>
<td class="right">
  <input type="text" title="Tax Deductibility" class="textInput" name="customfields-tf-13-tf" id="customfields-tf-13-tf" size="40" />
 </td>
 </tr>
  • 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-14T04:20:21+00:00Added an answer on May 14, 2026 at 4:20 am

    I believe that in order to disable an input you need to use:

    $(input).attr("disabled", "disabled");
    

    Also, some of these functions might prove useful for you:

    $.fn.enable = function() {
      return this.removeAttr('disabled');
    }
    
    $.fn.disable = function() {
      return this.attr('disabled', 'disabled');
    }
    
    $.fn.disenable = function(val) {
      if (val)
        return this.enable();
      else
        return this.disable()
    }
    
    $.fn.toggleEnabled = function() {
      if (this.attr('disabled') == 'disabled')
        return this.enable();
      else
        return this.disable();
    }
    

    once they’ve been defined, you can then use them on any jQuery variable, like so:

    $(input).toggleEnabled();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 373k
  • Answers 373k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer One way would be to handle this manually: use a… May 14, 2026 at 7:41 pm
  • Editorial Team
    Editorial Team added an answer Create new specific class, that will keep the Group object… May 14, 2026 at 7:41 pm
  • Editorial Team
    Editorial Team added an answer Just a guess but, something like this? $("#logo-upload-form").live("submit", function ()… May 14, 2026 at 7:41 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.