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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:09:40+00:00 2026-06-05T16:09:40+00:00

I have code which has a drop down list. And when a certain option

  • 0

I have code which has a drop down list. And when a certain option of the drop-down list is selected, its assigned DIV is shown with the other div’s hidden. If another option is selected, then the existing DIV is hidden and its assigned div is shown.

But, the div’s being shown/hidden isn’t working properly.

Firebug reports the following (arrow points to the ‘$’):

missing ( before switch expression
[Break On This Error]     

switch $(this).val(){

Below is the jQuery code:

$('#ddlOptions').change(function(){
    $('div.Results').hide();
    switch $(this).val(){
      case '1': $('#divResults1').show();break; 
      case '2': $('#divResults2').show();break;
      case '3': $('#divResults3').show();break;
    }
  });
  • 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-05T16:09:41+00:00Added an answer on June 5, 2026 at 4:09 pm

    Because it should be: switch ($(this).val()) instead of switch $(this).val()

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

Sidebar

Related Questions

I have a drop down list box which has one of the values to
I have a form which has a drop down list for countries. If the
I have a PHP based form. It has a drop down list which fetches
I have a drop down which has many options. I want that when I
I have a C++ code which has 3 array declarations. float A[NUM]; float B[NUM];
I have some code which I think has extra release statements. Is the code
Imagine you have class A which has code which runs as method M. And
I have a C code in which I have a structure declaration which has
I have code which performs query on Jboss server. It has JNDI based datasource
I have a large library of code which has a few (much too few)

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.