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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:34:05+00:00 2026-06-15T12:34:05+00:00

Ill post an image to explain it better. So, imagine that I make a

  • 0

Ill post an image to explain it better.

enter image description here

So, imagine that I make a 1st search, then I make a 2nd, or 3rd, 4th..search and I want to back to my old searches.

I already have some code that saves old searches (working fine). My only problem is how to assign the values to a combobox in order to comboboxes return to an old state.

How could I start doing this?

edit:

$('#combos').on('change', '.combo', function() {
        var selectedValue = $(this).val();

        if (selectedValue !== '' && $(this).find('option').size() > 2) {
            var newComboBox = $(this).clone();
            var thisComboBoxIndex = parseInt($(this).attr('data-index'), 10);
            var newComboBoxIndex = thisComboBoxIndex + 1;
            $('.parentCombo' + thisComboBoxIndex).remove();
            newComboBox.attr('data-index', newComboBoxIndex);
            newComboBox.attr('id', 'combo' + newComboBoxIndex);
            newComboBox.addClass('parentCombo' + thisComboBoxIndex);
            newComboBox.find('option[value="' + selectedValue + '"]').remove();
            $('#combos').append(newComboBox);
        }
        });


var check_combo_box_values = $('#combos .combo').map(function () 
                {
                    return $('option:selected', this).map(function() {
                    return parseInt(this.value);
                    }).get();
                }).get();
  • 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-15T12:34:07+00:00Added an answer on June 15, 2026 at 12:34 pm

    I made a fiddle how to add options to a combobox

    http://jsfiddle.net/hRQqp/2/

    Since you stated you had no troubles with saving the old searches, you should be able to put the pieces together

    var dropdown = document.getElementById('dropdown');
    var list = [
        "first",
        "second",
        "third"
    ];
    
    // remove old options
    while (dropdown.length> 0) {
        dropdown.remove(0);
    } 
    
    // add new ones
    for (var i=0;i<list.length; i++) {
        var option = document.createElement("option");
        option.textContent = list[i];
        option.value = i;
        dropdown.appendChild(option);
    }​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Not sure how to explain this, so I'll first post some code and then
I dont think this is possible in c# but ill post it anyway. Given
I'll post my code first, and then ask questions. def menu(**arg): if len(arg) ==
I am a little bit stuck up. First, I'll post the screenshot and then
ill have an if statement if (int1 < int2) {} else {} I want
I have an image upload script, and the thumbnails that its producing are posterized
ill try again :/ im setting up a blog page, i want it to
I have a variety of image sets that I'm displaying on a web page
I have a function that gets an image from a form, and put's it
Hi all am trying to on click go to the next image (I'll post

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.