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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:02:17+00:00 2026-05-14T07:02:17+00:00

I am trying to enhance a form, by showing only relevant fields depending on

  • 0

I am trying to enhance a form, by showing only relevant fields depending on initial selection via a form select field.

It is an order form for 3 products and all 3 products have unique properties.

My idea was to hide all the content in divs, then reveal the relevant div when the product is selected. I have found some solutions that show / hide a div, but none with any animation. It doesn’t have to be a slide but just something nice!

The alternative is instead of revealing a div, would be to load a seperate form, but this seems unnecessary.

I am not sure whether i need a plug in, as I am pretty new to jquery.

What i have in the html is:

<style type="text/css">
.hide {
 display:none;
}

<select>
<option value="" >Please select product below</option>
<option value="pro1">Product 1</option>
<option value="pro2">Product 2</option>
</select>

<div id="pro1" class="hide" >Product 1</div>
<div id="pro2" class="hide" >Product 2</div>

Many thanks in advance

  • 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-14T07:02:17+00:00Added an answer on May 14, 2026 at 7:02 am

    You can use the slideUp() and slideDown built-in effect.

    Or any of the other built-in effects for jQuery. http://api.jquery.com/category/effects/

    $(document).ready(function () {    
           $("#selectMenu").bind("change", function () {
            if ($(this).val() == "pro1") {
                $("#pro1").slideDown();
                $("#pro2").slideUp();
            }
            else if($(this).val() =="pro2") {
                $("#pro2").slideDown();
                $("#pro1").slideUp();
            }
        });
    });
    

    HTML:

    <select id="selectMenu"> 
        <option value="" >Please select product below</option> 
        <option value="pro1">Product 1</option> 
        <option value="pro2">Product 2</option> 
    </select> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to enhance my Logger class with some conditionals to control what
I'm trying to enhance my program with some logging functionality provided by System.Diagnostics .
I'm trying to enhance Qt's QPrintPreviewWidget by allowing it to display page numbers (in
Hoho there. I was just trying to enhance the performance of my application (.NET
I am trying to use ANN for pitch detection of musical notes. The network
All reservations about unsecuring your SecureString by creating a System.String out of it aside
Bear with me as I try to learn more about .htaccess redirect rules -
I'm an Information Architect and JavaScript developer by trade nowadays, but recently I've been
As my Rails app matures, it's becoming increasingly apparent that it has a strong

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.