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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:04:15+00:00 2026-06-12T23:04:15+00:00

I have this, <select id=rid style=border: 1px solid #ccc; name=rid> <option value=1>Option 1</option> <option

  • 0

I have this,

<select id="rid" style="border: 1px solid #ccc;" name="rid">
    <option value="1">Option 1</option>
    <option value="2">Option 2</option>
    <option value="3">Option 3</option>
    <option value="4">Option 4</option>
    <option value="5">Option 5</option>
    <option value="6">Option 6</option>
</select>

and i have this links that triggers an event,

<a href="#">Disable Option 1</a><br />
<a href="#">Disable Option 2</a><br />
<a href="#">Disable Option 3</a>

Now if I click Disable Option 1, this would disable Option 1 from the selection dropdown. I’m thinking, by using the attribute value, I can specify what option to disable with regards to what link I will click but I am lost. How would I disable any option on the dropdown just using the value attribute?

  • 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-12T23:04:16+00:00Added an answer on June 12, 2026 at 11:04 pm

    Edit:

    like for instance when clicking Disable Option 1, it will disable options 1, 4 and 5 and when I click Disable Option 2 it will disable options 2 and 3, somewhat like that.

    Setup links like below,

    <a href="#" data-val="1,4,5">Disable Option 1</a><br />
    <a href="#" data-val="2,3">Disable Option 2</a><br />
    <a href="#" data-val="3">Disable Option 3</a>
    

    And change code like below,

    $('a').click (function () {
        var thisVal = $(this).data('val')+'';
        $('#rid option').filter(function () {            
            return $.inArray(this.value, thisVal.split(',')) >= 0;
        }).prop('disabled', true);
    });
    

    DEMO: http://jsfiddle.net/vPhJc/1/


    If you setup links like below,

    <a href="#" data-val="1">Disable Option 1</a><br />
    <a href="#" data-val="2">Disable Option 2</a><br />
    <a href="#" data-val="3">Disable Option 3</a>
    

    Then you can

    $('a').click (function () {
        $('#rid option[value=' + $(this).data('val') + ']').prop('disabled', true);
    });
    

    DEMO: http://jsfiddle.net/vPhJc/

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

Sidebar

Related Questions

I have this, <select id=rid style=border: 1px solid #ccc; name=rid> <option value=1>Option 1</option> <option
I have the following HTML: <select id=testMe name=test multiple=multiple size=5 style=width:270px> <option value=test1>test1</option> <option
If I have this select: <select id=days> <option value=0>Today</option> <option value=1>Yesterday</option> <option value=7>Last week</option>
ok so i have some select tags of cities <select onchange=storeCity(this.value, false) name=search[city] id=search_city
I have this select input in my form that I want to access via
We have this statement: (SELECT res_bev.bev_id, property_value.name AS priority FROM res_bev, bev_property, property_value WHERE
i have a query in access that is this: SELECT iif([Cup Type] like '*Cylinder*',count([Cup
I have a table that looks like this: name | surname ------------------ John |
I have an select on my page with the value of Test One <option
I have this query in SQL Server 2005: SELECT J.JobID, dbo.tblCustomers.Name AS CustomerName, J.CustomerJobNumber,

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.