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

  • Home
  • SEARCH
  • 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 6794345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:12:40+00:00 2026-05-26T18:12:40+00:00

Is this case possible using JavaScript or jQuery ? When the value of the

  • 0

Is this case possible using JavaScript or jQuery?

When the value of the select box with class cl_preAction is set to the option of ‘003’ "End of World", the options in the select box "cl_prePRRS" 01,02,03 should be removed or grayed out (not possible to select – if this is possible)

Note that this pattern will repeat several times on a page, so using the same id will not work.

$('.cl_preAction').live('change', function (){  
     if ($(this).val() =='003'){
     $(this).parent().parent()...
});



<tr>
    <td>Action</td>
    <td class='none'>
       <div data-role='fieldcontain' class='none'>
        <select name='ACTC' class='none cl_preAction'   data-theme='a'>
            <option data-location='S' value='001'>Fire</option>
            <option data-location='T' value='002'>Flood</option>
            <option data-location='T' value='003'>End Of World</option>
        </select>
       </div>
    </td>
</tr>
<tr>
    <td>Reason</td>
    <td class='none'>
        <div data-role='fieldcontain' class='none'>
            <select name='PRRS' class='none cl_prePRRS'   data-theme='a'>
                <option value='01'>Rebuild</option>
                <option value='02'>Relocate</option>
                <option value='03'>Cash Payment</option>
                <option value='04'>Send registered letter indicating this event is not covered</option>
                    </select>
        </div>
    </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-26T18:12:40+00:00Added an answer on May 26, 2026 at 6:12 pm

    Your first issue will be that disabling select options doesn’t work reliably across all browsers and versions. Your best bet is to remove the options you don’t want but you could also create something that forces the user to select another option when required.

    You’re also going to have a problem with different rules for each of the select box pairings. Unless when you select option 3 in the ‘control’ select box it always blanks out options 1,2,3 of the target select box.

    I would use a ‘data’ attribute…

        <select name='ACTC' class='none cl_preAction' data-theme='a' data-target-select="cl_prePRRS">
    
        $('.cl_preAction').live('change', function (){  
            var me = $(this);
            if (me.val() =='003') {
                $("."+me.attr("data-target-select")).filter(function() {
                    return ($(this).val() != '03');  // I think you really want 04 here.
                }).remove();
            }
       });
    

    Don’t go down the road of trying to jump through the DOM unless you really have to. It’s convoluted and heaven forbid you’d ever need to move a select box or change the page structure.

    You’ll notice that this solution will only remove the options that aren’t = ’03’ in the target select box. You could easily add another “data” attribute that will allow you to pass in a list of options that should be kept and/or should be removed. You could do this by index of the options but that would be a little less flexible and harder to figure out.

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

Sidebar

Related Questions

is possible do a case in a group by? similar to this: select *
Is this code possible? switch (rule) { case 'email' || 'valid_email': valid = this.validate_email(field);
I am using this jQuery plugin: http://api.jquery.com/slideToggle/ I have this code: <div id=panel><form action=postit.php
I'm working on a case resolution system, and am currently using a jquery colorbox
Consider this case: dll = LoadDLL() dll->do() ... void do() { char *a =
Imagine this case where I have an object that I need to check a
In this case the license is question is Apache License v2, but basically if
In this case, the Visual Studio designer generates a method which takes the parameter
In this case, is it bad to subscribe to the proxy CloseCompleted event? public
Consider this case: public Class1 { public static final String ONE = ABC; public

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.