We help IT Professionals succeed at work.
Get Started

jquery show/hide options in form

movieprodw
movieprodw asked
on
179 Views
Last Modified: 2015-04-14
Hello,

I have the following form setup and can not figure out how to make it so when the category is chosen it shows the options relating in the lower select.

I have the jquery library linked on the page FYI.

<form id="select-form">
	<select id="parent-select">
        <option class="options1" value="cat0ne">First Category</option>
        <option class="options2" value="cat2wo">Second Category</option>
        <option class="options3" value="cat3hree">Third Category</option>
    </select>
    <select id="options">
        <option class="option1" value="yuil">This option yuil</option>
        <option class="option1" value="ly">This option ly</option>
        <option class="option2" value="hmfgh">This option hmfgh</option>
        <option class="option3" value="weg">This option weg</option>
        <option class="option1" value="fghjfg">This option fghjfg</option>
        <option class="option2" value="afdg">This option afdg</option>
        <option class="option3" value="erty">This option erty</option>
        <option class="option2" value="ndf">This option ndf</option>
        <option class="option1" value="trhe">This option trhe</option>
        <option class="option2" value="fgh">This option fgh</option>
        <option class="option3" value="ashgh">This option ashgh</option>
        <option class="option3" value="weaf">This option weaf</option>
        <option class="option3" value="asdf">This option asdf</option>
        <option class="option1" value="we">This option we</option>
        <option class="option1" value="fd">This option fd</option>
        <option class="option2" value="fds">This option fds</option>
        <option class="option1" value="asdf">This option asdf</option>
    </select>
</form>

Open in new window

Comment
Watch Question
CERTIFIED EXPERT
Most Valuable Expert 2013
Awarded 2012
Commented:
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE