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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:27:33+00:00 2026-05-31T10:27:33+00:00

I have 2 drop down menus, the options in the second drop down menu

  • 0

I have 2 drop down menus, the options in the second drop down menu depend on the first selection, in other words, the options from second drop down is generated after the first options gets selected. My question is, after clicking the submit button, my page will make get call with all the parameters from the form, but how can I keep the second drop down menu’s options available and display the previous selected. I have pasted some code to help explain in depth:

function generateOptions(selected) 
  { 
  var Obj = //a dictionary mapping items from first drop down menu with possible options 
  var selected_item = selected.options[selected.selectedIndex].text 
  var options = jsonObj[selected_item]   
  for(var i=0; i<options.length;i++) 
    { 
    jq('#second_menu').append( 
      jq('<option></option>').val('second_menu_option') 
      .html(options[i]) 
    ); 
    } 
  } 

I used the above codes to generate options for the second drop down menu. Please comment if you want some more info to help. Thanks!!!!!

  • 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-31T10:27:35+00:00Added an answer on May 31, 2026 at 10:27 am

    do not disturb the form.. it will get reset if the page gets reloaded.. use an ajax GET call to submit the form, that way your select boxes will still have the old values populated in it

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

Sidebar

Related Questions

I have 2 drop-down menus. User selects something from the first one, then the
I have a page with several multiselect drop-down menus. Each menu has a general
I am attempting to show drop down options in a second selection drop down
I have created 2 drop down menus, from and to, these include times starting
I have a drop down menu and it works perfectly on everything except IE6
I have a drop down menu in an ASPX page along the lines of:
I have a drop down menu made with Jquery. Right now, if you hover
We have a drop-down menu of volumes in our UI, and I'd like to
I have the following drop down menu and the background looks black in Chrome
I've run on a little problem today: I have a JS drop down menu

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.