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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T11:19:38+00:00 2026-06-02T11:19:38+00:00

I have 3 select or option drop lists that based on what the users

  • 0

I have 3 select or option drop lists that based on what the users selects needs to populate or select the select value of the drop list based on the query string. So I guess I need help getting the URL and query string and find out if it contains any of what the user selected to populate the select value.

Right now my select values are not persistent when a user selects them, then submits a search. How would I keep them persistent with Javascript or jQuery?
My other issue is that the user can search All options, I have that working but there is a Checkbox that places a value and the value is read to search everything. How would I, on the first page load, have that check box checked and the query string of ‘?search=%20%20%200’ to populate the URL query string. Thanks in advance.

Here is my current JS:

var resourceGradeId;
var resourceContentId;
var resourceProgramTypeId;
var resourceSearchAll;

$(document).ready(function() {

var searchAll = '<strong>' + "All" + '</strong>';
$('#xsltsearch_summary .dmnsSearchResultNumber:contains("0")').replaceWith(searchAll); 

$("#resourceSelect").click(function (event) { 
resourceGradeId = $('#teachersResourceSearchGrade').val();
 resourceContentId = $('#teachersResourceSearchContent').val();
 resourceProgramTypeId = $('#teachersResourceSearchProgramType').val(); 
resourceSearchAll = $('#teachersResourceSearchAll').val();
window.location.href = '/teachers/classroom-resources?search=' + resourceGradeId + ' ' + resourceContentId + ' ' + resourceProgramTypeId + ' ' + resourceSearchAll;
    });

$("select option").attr('disabled', false);

    $(":checkbox").click(function(event) { 
    //reset values
    if($(":checkbox").is(":checked")){
          $("#teachersResourceSearchGrade").val('');
          $("#teachersResourceSearchContent").val('');
          $("#teachersresourceProgramTypeId").val('');
          $("#teachersResourceSearchAll").val('0');
          $("select").attr('disabled', true);
        }
    else
        { 
          $("#teachersResourceSearchAll").val('');
          $("select").attr('disabled', false);
          $("select option").attr('disabled', false);
          }
     });
});
  • 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-02T11:19:41+00:00Added an answer on June 2, 2026 at 11:19 am

    Just used this

    var myQuery = window.location.search.substring(1);
    
    // alert(myQuery);
    
    if(myQuery == ''){
    
      window.location.href = document.URL + '?search=%20%20%200';
    
    $(":checkbox").attr('checked', 'checked');
    
    //alert('no query');
    
    }else if(myQuery == 'search=%20%20%200'){
    
      $(":checkbox").attr('checked', 'checked');
    
    } 
    
    else{
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this drop-down list of countries: <select name=country> <option value=>Country...</option> <option value=Afganistan>Afghanistan</option> <option
I have the following drop down list: <select name=selSS1 id=select_value> <option value=val0>sea zero</option> <option
I have the following drop down list and selects the option based on the
When I have simple drop down box <select id=fruits> <option value=apple>Apple</option> <option value=orange>Orange</option> <option
Currently, I have two drop down lists that are populated with users' first and
I have a drop-down list that I need to capture the value of when
I have a drop down list displaying values in a select tag that I
I have two drop down lists. Second one is populated based on value chosen
Ok here goes: I have a SELECT drop down option with US state names
I have n drop-downs like this: <select id=select1> <option>1</option> <option>2</option> <option>3</option> </select> <select id=select2>

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.