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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:17:29+00:00 2026-05-13T23:17:29+00:00

I have two select lists, I would like jquery to either remove or disable

  • 0

I have two select lists, I would like jquery to either remove or disable a select option, depending on what is selected from the first select list:

<select name="booking" id="booking">
  <option value="3">Group Bookings</option>
  <option value="2" selected="selected">Port Phillip Bay Snapper Charters</option>
  <option value="6">Portland Tuna Fishing</option>
  <option value="1">Sport Fishing</option>
</select>

Here’s the second list (which will only ever have two values):

<select name="charterType" id="charterType">
  <option value="1">Individual Booking</option>
  <option value="2">Group Booking</option>
</select>

If Group Bookings or Port Phillip Bay Snapper Charters are selected, I need only “Group Booking” to be displayed. (To basically hide “Individual Booking”) but I can’t seem to get it to work.. If someone could help me that’d be great!! 🙂

I’ve also tried using a switch, but that doesnt work either..

/* select list */
  switch (jQuery('#booking :selected').text()) {
    case 'Sport Fishing':
      alert('AA');
    break;
    case 'Port Phillip Bay Snapper Charters':
      jQuery("#charterType option[value=1]").remove();
      alert('BB');
    break;
    case 'Portland Tuna Fishing':
      alert('CC');
    break;
    case 'Group Bookings':
      alert('DD');
    break;
  };

It alerts, but doesn’t do anything else..

  • 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-13T23:17:29+00:00Added an answer on May 13, 2026 at 11:17 pm

    This will do what you needed

    <select name="booking" id="booking">
      <option value="3">Group Bookings</option>
      <option value="2" selected="selected">Port Phillip Bay Snapper Charters</option>
      <option value="6">Portland Tuna Fishing</option>
      <option value="1">Sport Fishing</option>
    </select>
    
    <select name="charterType" id="charterType">
      <option value="1">Individual Booking</option>
      <option value="2">Group Booking</option>
    </select> 
    

    javascript

    $("#booking").change(function(){
      $("#charterType").empty();
      if ( $(this).val() != "3" &&   $(this).val() != "2" ){
        $("#charterType").append ( $('<option>').text("Individual  Booking").val("1") );
      }
    
      $("#charterType").append ( $('<option>').text("Group Booking").val("2") );
    
    });
    

    See: http://jsbin.com/ayato

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

Sidebar

Related Questions

I have two select elements, A and B: when A's selected option changes, B's
I have two drop down lists: <select name="branch"> <option value="b">Blacksburg</option> <option value="c">Christiansburg</option> <option value="f">Floyd</option>
I have dropdown lists in two forms in a single .jsp. I would like
I have a form that has two select lists: <select name=rating1 id=rating1> <option>1</option> <option>2</option>
I have two drop down lists and I would like to make it when
I have two Select lists, between which you can move selected options. When I
i have two dropdown list. first drop down:1 enter code here <form:select path=custName id=custName>
I have two identical select boxes (aside from their names, of course), and I
Currently, I have two drop down lists that are populated with users' first and
I have two drop-down lists populated from an array of same dates stored in

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.