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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:16:08+00:00 2026-06-05T12:16:08+00:00

I have a situation where in some cases a dropdownlist can contain a default

  • 0

I have a situation where in some cases a dropdownlist can contain a default value that is not selectable, once another value is changed, the default value should no longer be an option. From what I can tell, this concept does not exist natively, so I am trying to code it up with jQuery. All the DropDownLists which have this condition have a class ‘valueSkippedHyperSwap’ assigned to them. the value that needs to be removed is the caret ‘^’. Here is what I have, which is not working:

    $('.valueSkippedHyperSwap').change(function () {
        var node = $(this).has("value='^'");
        node.remove();
    });

per folks request, here is the HTML, though I cannot for the world in me figure out how to get it into a code block:

<!-- snip -->

<div class="questionItem">
<!-- snip -->
<select class="valueSkippedHyperSwap" id="answers_2__Answer" name="answers[2].Answer">
<option selected="selected" value="^">(^) Blank (skip pattern)</option>
<option value="0">(0) No</option>
<option value="1">(1) Yes</option>
<option value="-">(-) Not assessed</option>
</select></div>

<div class="questionItem">
<!-- snip -->
<select class="valueSkippedHyperSwap" id="answers_3__Answer" name="answers[3].Answer">
<option selected="selected" value="^">(^) Blank (skip pattern)</option>
<option value="0">(0) Clear speech-distinct intelligible words</option>
<option value="1">(1) Unclear speech-slurred or mumbled words</option>
<option value="2">(2) No speech-absence of spoken words</option>
<option value="-">(-) Not assessed</option>
</select></div>

<!-- snip -->

One of the key things to note here is that there is more than one input with the valueSkippedHyperSwap class name, so within the event, we have to use the $(this) to fine the correct option, cannot do another search.

  • 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-05T12:16:10+00:00Added an answer on June 5, 2026 at 12:16 pm

    Assuming your HTML is like this

    <select id="dd" class="valueSkippedHyperSwap"> 
        <option value="^">None</option>
        <option value="1">One</option>
        <option value="2">Two</option>    
    </select>
    

    The below script should remove item with value ^ if any other options are selected

    $(function(){
    
        $('.valueSkippedHyperSwap').change(function () {
           var item=$(this);
          if(item.val()!="^")
          {
            item.find("option[value='^']").remove();
          }
        });            
    
    });
    

    JsFiddle Sample http://jsfiddle.net/He5gP/10/

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

Sidebar

Related Questions

Situation: I have some persons with certain skills and they can/might belong to more
I have a situation where Guice is working for some bindings, and not at
I have a situation that is confusing me and was hoping for some help.
I have a situation where some object has to be passed as an argument
I have a situation where I need to notify some users when something in
I have a situation in which a managed DLL calls some unmanaged DLL. I
I have a situation where I want my program to read in some numbers
We have a situation where we want to use filter for URL's containing some
I have following Situation, Server A sends some data (HTML form) to server B,
I have a situation like this: start(); <Some code> end(); I want start() function

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.