I have a support page on our site that provides customers the ability to view product documents and software from a specific category. You can see it here [[LINK href="http://www.openeye.net/support/software-updates/"]]http://www.openeye.net/support/software-updates/[[/LINK]] The drop-down allows you to choose which product you would like view resources from.
I've been searching for a way to allow the user to choose the category first.
Then choose the product. Hopefully, without reloading the page.
I've posted information on wordpress.stackexchange but haven't received any conclusive answers. [[LINK href="null"]]http://wordpress.stackexchange.com/questions/10570/multiple-level-category-drop-down[[/LINK]]
Here is the current code for the category dropdown.
<form action="<?php bloginfo('url'); ?>/" method="get">
$select = wp_dropdown_categories('orderby=name&echo=0&depth=0&hierarchical=1&exclude=5,4');
$select = preg_replace("#<select([^>]*)>#", "<select$1 onchange='return this.form.submit()'>", $select);
<input type="submit" value="View" />
Any help would be appreciated.
Jurre Hanema answers:
I created a small plugin that should do what you want. It lets you select a category and then pulls the child categories from the server using an AJAX request, displaying them in a second drop down.
You can download it here: www.stack.nl/~jurre/mcd_plugin.zip
In your theme, at the location where you want the two dropdowns to appear, simply insert the following code:
Please let me know if it works for you!
Zach Shallbetter comments:
Excellent, it partially works, when you select the item from the second category drop-down it doesn't take you to the category page. It also show's an empty short drop-down before you select the first one.
Could I also get it to say select-one as a default and only show one initially?