Drop Down Categories without Submit Button
-
Hi,
What I am trying to do is make the drop down Categories not have to use the submit button. Currantly there are two reasons: 1) I hate the submit button and love the on change function 2) it seems that something with the drop down catagories code that I have gotten from here doesn’t like how my host has my sub-domain set up. (When you hit submit it adds the subdirectory that the sub domain is set up in back to the end of the url, I believe the problem stemmed the<?php echo $PHP_SELF; ?>
code)
Anyway, I noticed that the archives my month (that is also drop down) didn’t have that problem so I thought by taking the code from there and modifying it for Categories I might be able to solve the problem, which it did, now I just get a page not found because I can’t get the categories urls to insert into the code.
Here is the code I used:
<li id="categories"><?php _e('Categories:'); ?>
<form action="" method="get" name="categories">
<select name="cat_name" onchange="window.location = (document.forms.categories.cat_name[document.forms.categories.cat_name.selectedIndex].value);">
<option value=''>By Name</option>
<?php dropdown_cats(); ?>
</select>
</form>
if anyone can help I would be in your debt.
- The topic ‘Drop Down Categories without Submit Button’ is closed to new replies.