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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:44:51+00:00 2026-05-18T10:44:51+00:00

I have a dropdown list with 24 items, the user can check a radio

  • 0

I have a dropdown list with 24 items, the user can check a radio button and this will set it to only show 12. If they de-select it, the dropdown will show the 24 items as before.

I have it working to only show 12 items using

document.getElementById('theMenu').length = 12;

But then when I try to set it back to 24, the other 12 items are empty.

Am thinking I may need to store the values in a temp array of some sort, then just load these back into the dropdown menu? (Javascript only)

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-18T10:44:52+00:00Added an answer on May 18, 2026 at 10:44 am

    Yes setting the length to 12 is destroying the second 12 values.

    It may be benifical to put these elements in memory when the page is ready and not to manipulate that array (use it as a constant), populate another array with ones you need, create a method that takes an array and populates a drop down (you could hard-code the target array, or make the target Id another parameter).

    Are you able to use the JQuery library? I would suggest so. It will most probably have some useful methods for manipulating <select>s.

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

Sidebar

Related Questions

I have a dropdown list of items a user can select from (the view
I have a dropdown list populated with some items. When the user selects one
I have a dropdown list (FK) which I would like to set and display
I have a dropdown list. I am using onchange event of this dropdown to
I have this code on controller side to initialise the drop down List<SelectListItem> items
I have a winform containing a DropDown combobox, where the user can enter a
I have a set of questions the user can choose from and some of
I have a dropdown list with a few options and a group of checkboxes
I have a dropdown list containing the days of the week - Monday to
I have a dropdown list with a piece of code that is run when

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.