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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:31:24+00:00 2026-05-17T02:31:24+00:00

I have a listbox in a form, and based on the answers within I

  • 0

I have a listbox in a form, and based on the answers within I want to open a different toggle, using JQuery UI’s toggle effect: http://jqueryui.com/demos/toggle/. The code is visible under ‘view source’.

Part 1: the code in current form does not support multiple toggles on one page. How can I rewrite the javascript and id the divs differently so multiple toggles respond to multiple links?

Part 2: how can I then take a listbox (like below) and get the three options to select from among two toggled divs?

<select class="toggle inputBox listBox" id="select" name="customer[option]"> 
  <option>Choose Your Option</option> 
  <option value="1" rel="toggle[one]"> Option 1</option>
  <option value="2" rel="toggle[one]"> Option 2</option>
  <option value="3" rel="toggle[two]"> Option 3</option>
</select>
  • 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-17T02:31:25+00:00Added an answer on May 17, 2026 at 2:31 am

    I’m not 100% sure on your question, but if you just want a different animation based on the selected option you can do something like this

    HTML

    <div>Hey, what?</div>
    <select>
        <option>-</option>
        <option>1</option>
        <option>2</option>
    </select>​​​​​​​​​​​​​​​​​​​
    

    jQuery

    $('select').change(function() {
        switch (this.selectedIndex) {
        case 0:
            break;
        case 1:
            $('div').fadeOut(300, function() {
                $(this).show();
            });
            break;
        case 2:
            $('div').slideUp(300, function() {
                $(this).show();
            });
            break;
        }
    });​
    

    Fiddle

    http://jsfiddle.net/HJYYj/

    Edit

    Just read your question and understood that you want to hide a different element with each option. You can modify the above jQuery pretty easily for that.

    Updated Example: http://jsfiddle.net/yrNjS/

    Updated Code

    $('select').change(function() {
        switch (this.selectedIndex) {
        case 0:
            break;
        case 1:
            $('span').slideUp(500, function() {
                $(this).show();
            });
            break;
        case 2:
            $('div').slideUp(500, function() {
                $(this).show();
            });
            break;
        }
    });​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a ListBox on my Form, I want to save it and load
within a form I have two listbox controls these controls are used for mapping
I have ListBox called lstProductGroups. On a simple Windows Form, a method called GetGroups
So I have a form that has a listbox that shows like a ledger.
I use Visual studio 2008 I have 5 listbox's on form,I created a new
I have a listbox in a Microsoft Access form. The MultiSelect property is set
I have a continuous form where i have a listbox assigned to an ID.
Let's say I have a listbox and two buttons in a windows form application.
I have a ListBox on a Windows Form that is populated during the Form_Load
var d = $('form[name=aspnetForm]').formSerialize(); $.ajax({ type: POST, data: d }); I have a ListBox

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.