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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:24:35+00:00 2026-06-10T07:24:35+00:00

This is my example. <select name=mydropdownbox> <option value=val1>val1</option> <option value=val2>val2</option> <option value=val3>val3</option> <option value=val4>val4</option>

  • 0

This is my example.

<select name="mydropdownbox">
<option value="val1">val1</option>
<option value="val2">val2</option>
<option value="val3">val3</option>
<option value="val4">val4</option>
<option value="val5">val5</option>
<option value="val6">val6</option>
</select>​

as you can see, we have a select box with different options.
What i want to do is to hide option with val2 and val5, but add another option to the end of the list like <option value="more">more</option>.

By clicking “more” the hidden options should be shown. the option “more” should be replaced by an option “less”. By clicking less the options should be hidden again.

Please keep in mind that this is only an example. The full list contains more than 50 options. Would it be useful to some kind of array?

Unfortunately I have no idea how to start.
Any help on this would be greatly appreciated. Thanks.

UPDATE
Please have a look at my comments in the js-Part http://jsfiddle.net/bqyBQ/5/

  • 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-10T07:24:36+00:00Added an answer on June 10, 2026 at 7:24 am

    I would try something like this

    <select id="mydropdownbox" name="mydropdownbox">
        <option value="val1">val1</option>
        <option value="val2">val2</option>
        <option value="val3">val3</option>
        <option value="val4" class="hide">val4</option>
        <option value="val5" class="hide">val5</option>
        <option value="val6" class="hide">val6</option>
        <option value="more" class="more">more</option>
    </select>​
    
    <style type="text/css">
      .hide { display: none; }
    </style>
    
    <script type="text/javascript">
      jQuery('#mydropdownbox .more').click(function() { 
        jQuery('#mydropdownbox .hide').attr('class', 'show');
      });
    </script>
    

    Just put a new class to these elements, which should be hidden per default. Then add a click event to the more link to toggle these classes. It would be easy to make a less button with this technique too.

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

Sidebar

Related Questions

For example: select name from person where id=2; I wand to know if this
I have this code (an example that PHP generates for me)... <select id=outsideBlue3> <option
if for example this query returns a table name called invoice : select table_name
I am trying to display(block,none) select boxes(in this example only one select box) through
I am learning LINQ and was trying out this example related to select clause.
Say for example this is my code: $query = SELECT * FROM ...; $exec_query
i'm trying to do this query: SELECT * FROM TABLE WHERE value1='THIS'S AN EXAMPLE'.
I need to do this select statement in Oracle: (example in TSQL for MS
Check out this query example: (SELECT fistName, middleName, lastName FROM a) UNION (SELECT fistName,
If I have two tables, like this for example: Table 1 (products) id name

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.