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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:49:08+00:00 2026-06-01T21:49:08+00:00

I have 2 drop-downs. The first drop-down is the design color. The second one

  • 0

I have 2 drop-downs. The first drop-down is the design color. The second one is what the design is going to be printed on. Sometimes we have red designs, but they can’t be printed on red wraps as the colors would blend together. I am trying to split the first option to give me the color that it is and if it matches an option from below to disable it. When another option is chosen the disabled option will refresh.

My idea was to create a str and use it to see if it is in the option name. It doesn’t seem to work so I think I am missing something small. If I replace "str" with "Red" for example it disables red, but it won’t work on the fly which is what I need it to do. Any help would be greatly appreciated.

This is the piece where I am struggling:
$(designColor).children(‘option:contains(str)’).attr(‘disabled’,’disabled’);

<p>
<select onchange="change_option('SELECT___LX-03675___185',this.options[this.selectedIndex].value)" name="SELECT___LX-03675___185">
<option selected="" value="0">Choose Water Bottle WRAP Color</option>
<option value="1343">Black Water Bottle</option>
<option value="1052">Green Water Bottle</option>
<option value="1874">Purple Water Bottle</option>
<option value="1051">Red Water Bottle</option>
<option value="1053">Royal Water Bottle</option>
<option value="1813">Pink Water Bottle</option>
</select><br>
<select onchange="change_option('SELECT___LX-03675___529',this.options[this.selectedIndex].value)" name="SELECT___LX-03675___529">
<option selected="" value="0">Choose Water Bottle DESIGN Color</option>
<option value="2519">Pink Design Water Bottle</option>
<option value="2520">Red Design Water Bottle</option>
<option value="2521" disabled="disabled">White Design Water Bottle</option>
<option value="2522">Black Design Water Bottle</option>
<option value="2523">Blue Design Water Bottle</option>
</select>
</p>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){

var wrapColor = $('select[name=SELECT___LX-03675___185]');
var designColor = $('select[name=SELECT___LX-03675___529]');

$(wrapColor).change(function () {
      var str = "";
      $(wrapColor).children("option:selected").each(function () {
            str += $(this).text().split(' ')[0] + " ";
          });


$(designColor).children('option').removeAttr('disabled');
$(designColor).children('option:contains(str)').attr('disabled','disabled');
      
    })
    .trigger('change');
});
</script>
  • 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-01T21:49:10+00:00Added an answer on June 1, 2026 at 9:49 pm

    I think it should be (not tested)

    $(designColor).children('option:contains('+str+')').prop('disabled',true);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my application i have two drop down boxes first box had origin second
I have two Drop Down Lists, the second ones are based off which one
I have 2 drop downs. In the first one you choose a model, in
I have two drop down lists. Second one is populated based on value chosen
i have two dropdown list. first drop down:1 enter code here <form:select path=custName id=custName>
I have a set of drop down lists (8 in all). All drop downs
I have a 'n' column table , the first column is a drop down
Currently, I have two drop down lists that are populated with users' first and
Simple ASP.NET application. I have two drop-down controls. On the first-drop down I have
I have 2 drop down lists , and value of the second drop down

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.