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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:24:44+00:00 2026-06-11T23:24:44+00:00

Hi and thanks for taking the time to answer my question. I have a

  • 0

Hi and thanks for taking the time to answer my question.

I have a div with two select elements (note that they’re dynamically created and don’t have ids). Both of them contain same option elements (Skill Levels that go from 1 to 5). When a user selects something from the SelectFrom dropbox I the second option (Select To) to only contain the options with value bigger than the selected in the Select From.

If the user selects the default element in the Select From dropbox (with no value) I want to repopulate the Select to with the 5 elements.

I figured out that i’m gonna have a hidden select element with all 5 options and I’m gonna clone those and repopulate the Select to dropbox.

What is the way to go forward. The tricky part is that I don’t have Ids so I’m working with parent() and siblings(). Thanks for your time

Let’s assume this is the HTML:

<div>
<select class="skillsFrom">
<option value="">Please select a value</option>
<option value="1">a</option>
<option value="2">a</option>
<option value="3">a</option>
<option value="4">a</option>
<option value="5">a</option>
</select>
<select class="skillsTo">
<option value="">Please select a value</option>
<option value="1">a</option>
<option value="2">a</option>
<option value="3">a</option>
<option value="4">a</option>
<option value="5">a</option>
</select>
</div>

here’s JS:
//btw helperSelect is a select with the same options as the other two it is just hidden.

('.skillsFrom').bind('change', function(){

            var $optionsSkillLevel = $('#helperSelect option').clone();

            var selectedValue = $(this).val();

            $(this).parent().siblings('.skillsTo').html($optionsSkillLevel);

            if(selectedValue != ''){

            }

        });

And I’m stuck. I’m not sure how to proceed from here. I want to iterate over all elements in Select To and remove those that are lower than the selected value from Select From

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

    On every change of the first select you need to hide/show certain options of the second one.

    $('.skillsFrom').change(function() {
        var theValue = $(this).val();
        if($(this).val()==="") {
            // show all values of .skillsTo if .skillsFrom select is set to ""
            $(this).parent().find('.skillsTo option').show();
        } else {
            theValue = parseInt(theValue, 10);
            $(this).parent().find('.skillsTo option').each(function() {
               if(parseInt($(this).val(), 10) <= theValue) {
                   // hide if value <= selected value from .selectFrom
                   $(this).hide();
               } else {
                   // show if value > selected value from .selectFrom
                   $(this).show();
               }
            });
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi all and thanks for taking the time to answer my question. I have
Hi and thanks for taking the time to answer my question. I have a
Thanks for taking the time to answer my question. I want to check if
First off good day and thanks for taking the time to answer my question.
Hi and thanks for taking the time to answer my question. Appreciate it. Let's
Hi and thanks for taking the time to answer my question. I need to
thanks for taking the time to look at my question. I've been diving into
Thanks for taking the time to read this. I have an unknown number of
thanks for taking the time to stop by my question. Below you will find
Thanks everyone for taking the time to read this. I have styled my navigation

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.