WordPress.org

Ready to get started?Download WordPress

Forums

Dropdown Fix? (7 posts)

  1. blazzinmatt
    Member
    Posted 8 years ago #

    If you view my page in IE the dropdown box for the categories is messed up. The categories are not in the box, but this only happens in IE.

    Here is the code for it:
    <form id="catform" action="<?php echo $PHP_SELF ?>" method="post">
    <p style="margin: 0px; padding: 0px;"> <select id="cat" onchange="submit(this.form);">
    <option value="">Select One</option>
    <?php dropdown_cats(); ?>
    </select>

    </form>

  2. blazzinmatt
    Member
    Posted 8 years ago #

    Anyone?

  3. Anonymous
    Unregistered
    Posted 8 years ago #

    You're trying to add extra code to the dropdown_cats(); function, and it won't work. I was curious to where you got this idea, and I assume you got it from the Codex: http://codex.wordpress.org/Template_Tags/dropdown_cats

    Bleh. I'm not sure what planet the person is who added those instructions to the page, but it's wrong. He not only suggests you nest a <select> tag with in another, but also says it will work! I attempted to write some JavaScript to get what you want accomplished, but it appears the onChange event doesn't work the same way embedded as it does inline. For what you want to do, you'd have to modify the core dropdown_cats(); function.

  4. blazzinmatt
    Member
    Posted 8 years ago #

    See but that thing I don't understand is why it works for the archives and not for the categories. It also works in Firefox, but not in IE

  5. Anonymous
    Unregistered
    Posted 8 years ago #

    It doesn't work like wp_get_archives() with the 'format=option' because dropdown_cats is much less complicated and does not have the features wp_get_archives does. wp_get_archives() with that option I mentioned outputs each archive section enclosed in <option> tags, without the <select> tags. It would make sense to deprecate dropdown_cats() and implement a 'format' option type in addition to the four possible values similar to wp_get_archives(). I checked just to be sure, it's not in the latest svn checkout. I'll file a bug in Trac for this.

  6. 9114619
    Member
    Posted 8 years ago #

    No being able to control the <select> using the dropdown_cats() was stupid to begin with. I don't understand why WordPress isn't constant in his flexibility (the wp_get_archives() is a perfect example).

  7. Richardson
    Member
    Posted 8 years ago #

    I am very interested in this as well. The site I'm working on, korealiberator.org, uses the drop down cats, but some of the cat names are long enough to cause the menu to extend off the page in FF/Mozilla, and causes the "Go" button to wrap under the menu in IE.

    After extensive searches, several refs to using 'select' but I have no idea where or how to implement that.

    If I knew where/what to edit in any of the core files, I'd give it a shot (and be ready to ftp the backup asap).

    What I want to do - set the width of the drop down cats menu. This is what I have;

    <h2>Categories</h2>
    <form action="<?php echo $PHP_SELF ?>"method="get">
    <p style="padding: 0px; margin: 0px;"> <?php dropdown_cats(); ?><input type="submit" name="submit" value="GO"/></form>

    This works, just looks terrible.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.